mii_manager.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <vector>
  6. #include "core/hle/result.h"
  7. #include "core/hle/service/mii/types.h"
  8. namespace Service::Mii {
  9. // The Mii manager is responsible for loading and storing the Miis to the database in NAND along
  10. // with providing an easy interface for HLE emulation of the mii service.
  11. class MiiManager {
  12. public:
  13. MiiManager();
  14. bool CheckAndResetUpdateCounter(SourceFlag source_flag, u64& current_update_counter);
  15. bool IsFullDatabase() const;
  16. u32 GetCount(SourceFlag source_flag) const;
  17. ResultVal<MiiInfo> UpdateLatest(const MiiInfo& info, SourceFlag source_flag);
  18. MiiInfo BuildRandom(Age age, Gender gender, Race race);
  19. MiiInfo BuildDefault(std::size_t index);
  20. ResultVal<std::vector<MiiInfoElement>> GetDefault(SourceFlag source_flag);
  21. ResultCode GetIndex(const MiiInfo& info, u32& index);
  22. private:
  23. const Common::UUID user_id{};
  24. u64 update_counter{};
  25. };
  26. }; // namespace Service::Mii