10 : playerState(state) {}
13 const auto it = seenCounts.find(ppl);
14 return it != seenCounts.end() ? it->second : 0;
18 static const std::string empty;
19 static const std::string unknown =
"Unknown";
20 const auto it = firstSawLocations.find(ppl);
21 if (it != firstSawLocations.end())
return it->second;
29 for (
const auto& p : playerState.
peoplemon) {
30 if (p.id() == ppl) ++c;
35 if (p.peoplemon.id() == ppl) ++c;
43 const unsigned int s =
getSeen(ppl);
45 if (c > 0)
return IntelLevel::FullIntel;
46 return s > 0 ? IntelLevel::LimitedIntel : IntelLevel::NoIntel;
50 auto it = seenCounts.find(ppl);
51 if (it == seenCounts.end()) { it = seenCounts.try_emplace(ppl, 0).first; }
53 if (it->second == 1) { firstSawLocations[ppl] = location; }
Core classes and functionality for both the editor and game.
void registerSighting(pplmn::Id peoplemon, const std::string &location)
Registers a sighting of the given peoplemon at the given location.
const std::string & getFirstSeenLocation(pplmn::Id peoplemon) const
Returns the name of the location the given peoplemon was first spotted at.
IntelLevel getIntelLevel(pplmn::Id peoplemon) const
Returns the level of intel on the given peoplemon.
unsigned int getSeen(pplmn::Id peoplemon) const
Returns how many of the given peoplemon have been seen.
unsigned int getCaught(pplmn::Id peoplemon) const
Returns how many of the given peoplemon have been caught.
Peopledex(State &playerState)
Construct a new Peopledex object.
IntelLevel
Represents an intel level on a given peoplemon.
std::vector< pplmn::OwnedPeoplemon > peoplemon
static constexpr int BoxCount
const std::vector< pplmn::StoredPeoplemon > & getBox(unsigned int box) const
Returns the given box. Performs no bounds check.