#ifndef CREATURELIB_SPECIESLIBRARY_HPP #define CREATURELIB_SPECIESLIBRARY_HPP #include "BaseLibrary.hpp" #include "CreatureData/CreatureSpecies.hpp" namespace CreatureLib::Library { class SpeciesLibrary : public BaseLibrary { private: ArbUt::Dictionary> _valuesById; public: SpeciesLibrary(size_t initialCapacity = 32) : BaseLibrary(initialCapacity){}; void Insert(const ArbUt::StringView& key, const CreatureSpecies* value) override { BaseLibrary::Insert(key, value); _valuesById.Insert(value->GetId(), value); } void Insert(uint32_t hashedKey, const CreatureSpecies* value) override { BaseLibrary::Insert(hashedKey, value); _valuesById.Insert(value->GetId(), value); } const ArbUt::BorrowedPtr& GetById(uint16_t id) const { return _valuesById[id]; } }; } #endif // CREATURELIB_SPECIESLIBRARY_HPP