#pragma once #include "CEntityComponent.h" #include "CWrapableBase.h" #include #include #include #include class CEntityTagsManager : public CEntityComponent { public: std::unordered_map> Tags; bool IsTagExist(const std::string& name); CWrapableBase* GetTag(const std::string& name); std::unique_ptr& AddTag(const std::string& name, CWrapableBase* ptr); //ptr then will be handled by unique_ptr inside CEntityTagsManager::Tags template T GetTagValue(const std::string& name, T defval = T{}) { CWrapableBase* tag = GetTag(name); if(!tag) { return defval; } return tag->GetCastValue(); } DEFINE_ENTITY_COMPONENT(); };