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/zone.h
parent66c776cc66d5c91ed3e798b0f5c5a30baf1f1d69 (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.h29
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;