Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-12 14:43:49 +0000
committerStijn Buys <ingar@osirion.org>2010-11-12 14:43:49 +0000
commitc0c2a0ccc335b00983bf69b99b7a44505ed24b47 (patch)
treeaed98bf43957595104810e6ba7d1ab278d2e8089 /src/core
parentd07d7e0d0ba022d555f418e9a072d71c190ed225 (diff)
made core::Entity::entity_shape a private attribute
Diffstat (limited to 'src/core')
-rw-r--r--src/core/entity.cc4
-rw-r--r--src/core/entity.h14
-rw-r--r--src/core/parser.cc8
3 files changed, 17 insertions, 9 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 8fde03a..7f48c08 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -1011,14 +1011,14 @@ EntityGlobe::EntityGlobe() : Entity()
{
render_texture = 0;
entity_rotationspeed = 0;
- entity_shape = Sphere;
+ set_shape(Sphere);
}
EntityGlobe::EntityGlobe(std::istream & is) : Entity(is)
{
render_texture = 0;
entity_rotationspeed = 0;
- entity_shape = Sphere;
+ set_shape(Sphere);
}
EntityGlobe::~EntityGlobe()
diff --git a/src/core/entity.h b/src/core/entity.h
index 954b261..48dd949 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -226,6 +226,11 @@ public:
/* ---- mutators -------------------------------------------------- */
+ /// assign shape
+ inline void set_shape(Shape shape) {
+ entity_shape = shape;
+ }
+
/// assign entity color
inline void set_color(const math::Color &color) {
entity_color.assign(color);
@@ -429,9 +434,6 @@ public:
/* entity_ variables can be set by the module */
- float entity_mass;
- float entity_speed;
- Shape entity_shape;
unsigned int entity_moduletypeid;
bool entity_created;
@@ -451,7 +453,11 @@ protected:
// the previous zone the entity belonged too
Zone* entity_oldzone;
+ float entity_mass;
+ float entity_speed;
+
private:
+
unsigned int entity_id;
unsigned int entity_flags;
@@ -464,6 +470,8 @@ private:
float entity_radius;
+ Shape entity_shape;
+
math::Color entity_color;
math::Color entity_color_second;
diff --git a/src/core/parser.cc b/src/core/parser.cc
index 8018bf7..3806b99 100644
--- a/src/core/parser.cc
+++ b/src/core/parser.cc
@@ -42,16 +42,16 @@ bool Parser::got_entity_key(filesystem::IniFile &inifile, core::Entity *entity)
if (inifile.got_key_string("shape", shapename)) {
if (shapename.compare("axis") == 0) {
- entity->entity_shape = core::Entity::Axis;
+ entity->set_shape(core::Entity::Axis);
return true;
} else if (shapename.compare("cube") == 0) {
- entity->entity_shape = core::Entity::Cube;
+ entity->set_shape(core::Entity::Cube);
return true;
} else if (shapename.compare("diamond") == 0) {
- entity->entity_shape = core::Entity::Diamond;
+ entity->set_shape(core::Entity::Diamond);
return true;
} else if (shapename.compare("sphere") == 0) {
- entity->entity_shape = core::Entity::Sphere;
+ entity->set_shape(core::Entity::Sphere);
return true;
} else {
con_warn << inifile.name() << " unknown shape '" << shapename << "' at line " << inifile.line() << std::endl;