diff options
Diffstat (limited to 'src/core/entity.h')
-rw-r--r-- | src/core/entity.h | 23 |
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); } |