#ifndef CREATURELIB_SCRIPTSET_HPP #define CREATURELIB_SCRIPTSET_HPP #include #include #include "Script.hpp" namespace CreatureLib::Battling{ class ScriptSet{ std::unordered_map _scripts; public: void Add(Script* script){ auto f = _scripts.find(script->GetName()); if (f != _scripts.end()){ f->second->Stack(); } else{ _scripts.insert({script->GetName(), script}); } } void Remove(const std::string& key){ _scripts.erase(key); } size_t Count() const{ return _scripts.size(); } const std::unordered_map * GetIterator() const{ return &_scripts; } }; } #endif //CREATURELIB_SCRIPTSET_HPP