Implements iterator functions for libraries.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-15 18:15:31 +01:00
parent 0b50d2bf43
commit a47f60cdf7
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
4 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,8 @@ namespace CreatureLib::Library {
void LoadAttack(const std::string& name, const AttackData* attack); void LoadAttack(const std::string& name, const AttackData* attack);
void DeleteAttack(const std::string& name); void DeleteAttack(const std::string& name);
const std::unordered_map<std::string, const AttackData*>& GetIterator() { return _attacks; }
}; };
} }

View File

@ -43,6 +43,8 @@ namespace CreatureLib::Library {
[[nodiscard]] const std::string& GetName() const; [[nodiscard]] const std::string& GetName() const;
void SetVariant(const std::string& name, const SpeciesVariant* variant); void SetVariant(const std::string& name, const SpeciesVariant* variant);
const std::unordered_map<std::string, const SpeciesVariant*>& GetVariantsIterator() { return _variants; }
}; };
} }

View File

@ -21,6 +21,8 @@ namespace CreatureLib::Library {
void LoadItem(const std::string& name, const Item* item); void LoadItem(const std::string& name, const Item* item);
void DeleteItem(const std::string& name); void DeleteItem(const std::string& name);
const std::unordered_map<std::string, const Item*>& GetIterator() { return _items; }
}; };
} }

View File

@ -28,6 +28,8 @@ namespace CreatureLib::Library {
void DeleteSpecies(const std::string& name); void DeleteSpecies(const std::string& name);
size_t GetCount() const { return _species.size(); } size_t GetCount() const { return _species.size(); }
const std::unordered_map<std::string, const CreatureSpecies*>& GetIterator() { return _species; }
}; };
} }