MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / learnCodex

Method learnCodex

source/game/StarPlayerCodexes.cpp:43–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43CodexConstPtr 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
54bool PlayerCodexes::codexRead(String const& codexId) const {
55 return m_codexes.contains(codexId) && m_codexes.get(codexId).second;

Callers 2

fireTriggeredMethod · 0.80
makePlayerCallbacksMethod · 0.80

Calls 3

singletonClass · 0.85
codexMethod · 0.80
codexDatabaseMethod · 0.80

Tested by

no test coverage detected