implement card auctions

This commit is contained in:
Martin Michelsen
2022-11-27 23:52:18 -08:00
parent 9f2f0ccc14
commit 41a858935b
10 changed files with 209 additions and 24 deletions
+10
View File
@@ -1241,6 +1241,11 @@ DataIndex::DataIndex(const string& directory, bool debug)
"duplicate card id: %08" PRIX32, entry->def.card_id.load()));
}
// Some cards intentionally have the same name, so we just leave them
// unindexed (they can still be looked up by ID, of course)
string name = entry->def.en_name;
this->card_definitions_by_name.emplace(name, entry);
entry->def.hp.decode_code();
entry->def.ap.decode_code();
entry->def.tp.decode_code();
@@ -1320,6 +1325,11 @@ shared_ptr<const DataIndex::CardEntry> DataIndex::definition_for_card_id(
return this->card_definitions.at(id);
}
shared_ptr<const DataIndex::CardEntry> DataIndex::definition_for_card_name(
const string& name) const {
return this->card_definitions_by_name.at(name);
}
set<uint32_t> DataIndex::all_card_ids() const {
set<uint32_t> ret;
for (const auto& it : this->card_definitions) {