diff --git a/src/Library/TypeLibrary.cpp b/src/Library/TypeLibrary.cpp index b14dbff..e7a808b 100644 --- a/src/Library/TypeLibrary.cpp +++ b/src/Library/TypeLibrary.cpp @@ -16,6 +16,7 @@ float TypeLibrary::GetSingleEffectiveness(uint8_t attacking, uint8_t defensive) } uint8_t TypeLibrary::GetTypeId(const ConstString& key) const { return _types.at(key); } +uint8_t TypeLibrary::GetTypeId(uint32_t s) const { return _types.at(s); } uint8_t TypeLibrary::RegisterType(const ConstString& key) { _types.insert({key, _types.size()}); diff --git a/src/Library/TypeLibrary.hpp b/src/Library/TypeLibrary.hpp index 1ea0d0d..dfc25c7 100644 --- a/src/Library/TypeLibrary.hpp +++ b/src/Library/TypeLibrary.hpp @@ -8,13 +8,14 @@ using ConstString = Arbutils::CaseInsensitiveConstString; namespace CreatureLib::Library { class TypeLibrary { - std::unordered_map _types; + std::unordered_map _types; std::vector> _effectiveness; public: - TypeLibrary(size_t initialCapacity = 20) : _types(std::unordered_map(initialCapacity)) {} + TypeLibrary(size_t initialCapacity = 20) : _types(std::unordered_map(initialCapacity)) {} uint8_t GetTypeId(const ConstString& s) const; + uint8_t GetTypeId(uint32_t s) const; float GetSingleEffectiveness(uint8_t attacking, uint8_t defensive) const; float GetEffectiveness(uint8_t attacking, const std::vector& defensive) const;