diff options
author | Stijn Buys <ingar@osirion.org> | 2012-10-08 19:58:08 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-10-08 19:58:08 +0000 |
commit | 14ea3d9d037175d4d5326ac9c83fe69ddcd0d9c4 (patch) | |
tree | ace65b7504daa0791a8dd79e4278db1ea1ef304b /src/core/zone.h | |
parent | 66c776cc66d5c91ed3e798b0f5c5a30baf1f1d69 (diff) |
added zone flags,
renamed Entity::flag_is_set() to Entity::has_flag()
Diffstat (limited to 'src/core/zone.h')
-rw-r--r-- | src/core/zone.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/core/zone.h b/src/core/zone.h index 644620d..22440c4 100644 --- a/src/core/zone.h +++ b/src/core/zone.h @@ -76,6 +76,8 @@ public: } /* ---- Zone class ----------------------------------------- */ + + enum Flags { Hidden = 1 }; /** * @brief create a new zone @@ -103,6 +105,18 @@ public: inline unsigned int id() const { return zone_id; } + + /// zone flags + inline const unsigned int flags() const { + return zone_flags; + } + + /** + * @brief returns true if a specified flag is set + * */ + inline const bool has_flag(const Flags flag) const { + return ((zone_flags & (unsigned int) flag) == (unsigned int) flag); + } /// ambient light color inline math::Color const & ambient_color() { @@ -144,6 +158,20 @@ public: Entity *search_entity(const std::string & label); /* ---- mutators ------------------------------------------- */ + + /** + * @brief set flag + * */ + inline void set_flag(Flags flag) { + zone_flags |= (unsigned int) flag; + } + + /** + * @brief unset flag + * */ + inline void unset_flag(Flags flag) { + zone_flags &= ~((unsigned int) flag); + } /** * @brief set the skybox name @@ -244,6 +272,7 @@ public: private: unsigned int zone_id; + unsigned int zone_flags; std::string zone_sky; math::Color zone_ambient_color; |