Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-10-08 19:58:08 +0000
committerStijn Buys <ingar@osirion.org>2012-10-08 19:58:08 +0000
commit14ea3d9d037175d4d5326ac9c83fe69ddcd0d9c4 (patch)
treeace65b7504daa0791a8dd79e4278db1ea1ef304b /src/core/entity.h
parent66c776cc66d5c91ed3e798b0f5c5a30baf1f1d69 (diff)
added zone flags,
renamed Entity::flag_is_set() to Entity::has_flag()
Diffstat (limited to 'src/core/entity.h')
-rw-r--r--src/core/entity.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/core/entity.h b/src/core/entity.h
index 07a3bec..19e47bc 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -44,7 +44,12 @@ class Entity : public Label
public:
/**
* @brief entity flags
- */
+ * NonSolid will exclude the entity from the bullet physics world
+ * Bright is used by EntityGlobe, where a bright sphere is a light source
+ * Dockable means the entity can be docked by a player
+ * ShowOnMap will make the entity appear on the map
+ * KeepAlive is used by EntityDynamic and marks the entity as deletable in the keepalive run
+ * */
enum Flags {NonSolid = 2, Bright = 4, Dockable = 8, ShowOnMap = 16, KeepAlive = 32};
/// Entity type constants
@@ -94,7 +99,7 @@ public:
}
/// returns true of a flag is set
- inline const bool flag_is_set(const Flags flag) const {
+ inline const bool has_flag(const Flags flag) const {
return ((entity_flags & (unsigned int)flag) == (unsigned int)flag);
}
@@ -321,14 +326,18 @@ public:
entity_axis.assign(axis);
}
- /// set flag
+ /**
+ * @brief set flag
+ * */
inline void set_flag(Flags flag) {
- entity_flags |= flag;
+ entity_flags |= (unsigned int) flag;
}
- /// unset flag
+ /**
+ * @brief unset flag
+ * */
inline void unset_flag(Flags flag) {
- entity_flags &= ~flag;
+ entity_flags &= ~((unsigned int) flag);
}
/**
@@ -684,7 +693,7 @@ public:
}
/// returns true if the specified control flag is set
- inline bool control_flag_is_set(ControlFlags flag) const {
+ inline bool control_has_flag(ControlFlags flag) const {
return ((flag && entity_control_flags) == flag);
}