osb/source/game/StarPlayerCodexes.hpp
2024-02-25 15:46:47 +01:00

39 lines
798 B
C++

#pragma once
#include "StarUuid.hpp"
#include "StarJson.hpp"
namespace Star {
STAR_CLASS(Codex);
STAR_STRUCT(CodexEntry);
STAR_CLASS(UniverseClient);
class PlayerCodexes {
public:
typedef pair<CodexConstPtr, bool> CodexEntry;
PlayerCodexes(Json const& json = {});
Json toJson() const;
List<CodexEntry> codexes() const;
bool codexKnown(String const& codexId) const;
CodexConstPtr learnCodex(String const& codexId, bool markRead = false);
bool codexRead(String const& codexId) const;
bool markCodexRead(String const& codexId);
bool markCodexUnread(String const& codexId);
void learnInitialCodexes(String const& playerSpecies);
CodexConstPtr firstNewCodex() const;
private:
StringMap<CodexEntry> m_codexes;
};
typedef shared_ptr<PlayerCodexes> PlayerCodexesPtr;
}