2022-03-17 08:48:31 +01:00
|
|
|
// Copyright 2020 yuzu Emulator Project
|
2020-07-11 04:52:07 +02:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-06-24 09:24:17 +02:00
|
|
|
#include <vector>
|
2022-03-17 08:48:31 +01:00
|
|
|
|
2020-07-11 04:52:07 +02:00
|
|
|
#include "core/hle/result.h"
|
|
|
|
#include "core/hle/service/mii/types.h"
|
|
|
|
|
|
|
|
namespace Service::Mii {
|
|
|
|
|
|
|
|
// The Mii manager is responsible for loading and storing the Miis to the database in NAND along
|
|
|
|
// with providing an easy interface for HLE emulation of the mii service.
|
|
|
|
class MiiManager {
|
|
|
|
public:
|
|
|
|
MiiManager();
|
|
|
|
|
|
|
|
bool CheckAndResetUpdateCounter(SourceFlag source_flag, u64& current_update_counter);
|
|
|
|
bool IsFullDatabase() const;
|
|
|
|
u32 GetCount(SourceFlag source_flag) const;
|
|
|
|
ResultVal<MiiInfo> UpdateLatest(const MiiInfo& info, SourceFlag source_flag);
|
|
|
|
MiiInfo BuildRandom(Age age, Gender gender, Race race);
|
|
|
|
MiiInfo BuildDefault(std::size_t index);
|
|
|
|
ResultVal<std::vector<MiiInfoElement>> GetDefault(SourceFlag source_flag);
|
|
|
|
ResultCode GetIndex(const MiiInfo& info, u32& index);
|
|
|
|
|
|
|
|
private:
|
2022-02-05 18:35:39 +01:00
|
|
|
const Common::UUID user_id{};
|
2020-07-11 04:52:07 +02:00
|
|
|
u64 update_counter{};
|
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace Service::Mii
|