#ifndef CREATURELIB_ATTACKLIBRARY_HPP #define CREATURELIB_ATTACKLIBRARY_HPP #include #include #include "Attacks/AttackData.hpp" namespace CreatureLib::Library { class AttackLibrary { private: std::unordered_map _attacks; public: AttackLibrary(size_t initialCapacity = 32) : _attacks(std::unordered_map(initialCapacity)){}; ~AttackLibrary() { for (auto attack : _attacks) { delete attack.second; } _attacks.clear(); } [[nodiscard]] const AttackData* GetAttack(const std::string& name) const; [[nodiscard]] const AttackData* operator[](const std::string& name) const; void LoadAttack(const std::string& name, const AttackData* attack); void DeleteAttack(const std::string& name); }; } #endif // CREATURELIB_ATTACKLIBRARY_HPP