| 41 | } |
| 42 | |
| 43 | CodexConstPtr PlayerCodexes::learnCodex(String const& codexId, bool markRead) { |
| 44 | if (!codexKnown(codexId)) { |
| 45 | if (auto codex = Root::singleton().codexDatabase()->codex(codexId)) { |
| 46 | auto entry = CodexEntry{codex, markRead}; |
| 47 | m_codexes[codexId] = entry; |
| 48 | return entry.first; |
| 49 | } |
| 50 | } |
| 51 | return {}; |
| 52 | } |
| 53 | |
| 54 | bool PlayerCodexes::codexRead(String const& codexId) const { |
| 55 | return m_codexes.contains(codexId) && m_codexes.get(codexId).second; |
no test coverage detected