00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef __cplusplus
00024
00025 # ifndef OGS_CORE_ENTITY_H
00026 # define OGS_CORE_ENTITY_H
00027
00028 # include <list>
00029 # include <utility>
00030
00031 # include <ogs/support/Object.h>
00032 # include <ogs/core/Defense.h>
00033 # include <ogs/core/Namespace.h>
00034 # include <ogs/core/Size.h>
00035 # include <ogs/core/Types.h>
00036
00037 OGS_BEGIN_CORE_NAMESPACE
00038
00044 class Entity: public ogs::support::Object {
00045 public:
00050 typedef double Weight;
00051
00061 typedef std::pair<int, int> Health;
00062
00063 const Size& getSize () const;
00064 Size& getSize ();
00065
00066 Weight getWeight () const;
00067 void setWeight (Weight weight);
00068
00069 const Defense& getDefense () const;
00070 Defense& getDefense ();
00071
00072 Health getHealth () const;
00073 void setHealth (Health health);
00074
00075 Features getFeatures () const;
00076 bool addFeature (Feature& feature);
00077 bool removeFeature (Feature& feature);
00078
00079 virtual ~Entity () = 0;
00080
00081 protected:
00082 Entity (Size::Type size = Size::MEDIUM, Weight weight = 0.0);
00083
00084 private:
00085 Size _size;
00086 Weight _weight;
00087 Defense _defense;
00088 Health _health;
00089 Features _features;
00090 };
00091
00097 inline const Size&
00098 Entity::getSize () const {
00099 return (this->_size);
00100 }
00101
00108 inline Size&
00109 Entity::getSize () {
00110 return (this->_size);
00111 }
00112
00119 inline Entity::Weight
00120 Entity::getWeight () const {
00121 return (this->_weight);
00122 }
00123
00129 inline const Defense&
00130 Entity::getDefense () const {
00131 return (this->_defense);
00132 }
00133
00141 inline Defense&
00142 Entity::getDefense () {
00143 return (this->_defense);
00144 }
00145
00151 inline Entity::Health
00152 Entity::getHealth () const {
00153 return (this->_health);
00154 }
00155
00161 inline Features
00162 Entity::getFeatures () const {
00163 return (this->_features);
00164 }
00165
00166 inline Entity::~Entity () { }
00167
00168 OGS_END_CORE_NAMESPACE
00169
00170 # endif
00171
00172 #endif
00173