/* base/template.h This file is part of the Osirion project and is distributed under the terms and conditions of the GNU General Public License version 2 */ #ifndef __INCLUDED_BASE_TEMPLATE_H__ #define __INCLUDED_BASE_TEMPLATE_H__ #include #include "math/color.h" #include "model/model.h" #include "core/info.h" namespace game { class Template : public core::Info { public: Template(); virtual ~Template(); /* --- inspectors ------------------------------------------------- */ inline const float radius() const { return template_radius; } inline const float maxarmor() const { return template_maxarmor; } inline const bool has_color() const { return template_has_color; } inline const math::Color & color() const { return template_color; } inline const bool has_color_second() const { return template_has_color_second; } inline const math::Color & color_second() const { return template_color_second; } virtual void print() const; /* --- actors ----------------------------------------------------- */ /** * @brief apply a template to an entity */ void apply(core::Entity *entity) const; /** * @brief read template keys from an ini file */ static bool got_template_key(filesystem::IniFile &inifile, Template *entitytemplate); protected: /* --- mutators --------------------------------------------------- */ void set_radius(const float radius); void set_color(const math::Color &color); void set_color_second(const math::Color &color_second); void set_maxarmor(const float maxarmor); public: /* --- static ----------------------------------------------------- */ static bool init(); static void done(); static void list(); static Template *find(const std::string & label); private: /* --- attributes ------------------------------------------------- */ float template_radius; math::Color template_color; bool template_has_color; math::Color template_color_second; bool template_has_color_second; float template_maxarmor; /* --- static ----------------------------------------------------- */ static core::InfoType *template_infotype; }; } // namespace game #endif // __INCLUDED_BASE_TEMPLATE_H__