#ifndef ATTRIBUTES_H_ #define ATTRIBUTES_H_ #include #include "Component.h" class Attributes { private: /// All components belongin to this Element std::vector _components; public: /// Base constructor Attributes() {}; /// Stats constructor Attributes(Statsmap stats); /// Full constructor Attributes(Statsmap stats, Stringmap strings); Attributes(std::vector components) {_components = components; }; /// Destructor ~Attributes(); /// Adds a Component to this elements attributes void AddComponent(Component * component) {_components.push_back(component); }; void AddComponents(std::vector components); /* STATS MANAGEMENT */ /// Return the max of a statistical value int GetMaxStat(std::string id, int component=-1); /// Set the max of a statistical value void SetMaxStat(std::string id, int val, int component=-1); /// Add a value to the max statistical value void AddMaxStat(std::string id, int val, int component=-1); /// Subtract a value from the max statistical value void SubMaxStat(std::string id, int val, int component=-1); /// Return the current value of a statistical value int GetCurStat(std::string id, int component=-1); /// Set the current value of a statistical value void SetCurStat(std::string id, int val, int component=-1); /// Add a value to the current statistical value void AddCurStat(std::string id, int val, int component=-1); /// Subtract a value from the current statistical value void SubCurStat(std::string id, int val, int component=-1); /// Restore the current value to the max void RestoreCurStat(std::string id, int component=-1); /// Set a string value void SetString(std::string id, std::string text, int component=-1); /// Get a string value std::string GetString(std::string id, int component=-1); /// Return if the stats is shared bool IsStatShared(std::string id, int component=-1) { return _components[component]->IsStatShared(id); }; /// Toggels a stats shared state false/true void ToggleStatShared(std::string id, int component=-1); /// Force toggles are Stat(id) shared state void ToggleStatSharedForced(std::string id); /// Return if the Component is active bool IsComponentActive(int id) { return _components[id]->IsActive(); }; /// Toggles a Component active state flase/true void ToggleComponentActive(int id) {_components[id]->ToggleActive(); }; }; #endif /*ATTRIBUTES_H_*/