Changeset 1949 for code/branches/objecthierarchy/src/orxonox/Settings.h
- Timestamp:
- Oct 19, 2008, 2:24:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/Settings.h
r1940 r1949 50 50 friend class ClassIdentifier<Settings>; 51 51 friend class GSRoot; 52 friend class GSGraphics;53 friend class GSServer;54 friend class GSClient;55 friend class GSDedicated;56 friend class GSStandalone;57 52 58 53 public: … … 62 57 { assert(singletonRef_s); singletonRef_s->_tsetDataPath(path); } 63 58 64 // an alternative to a global game mode variable65 static bool showsGraphics() { assert(singletonRef_s); return singletonRef_s->bShowsGraphics_; }66 static bool hasServer() { assert(singletonRef_s); return singletonRef_s->bHasServer_; }67 static bool isClient() { assert(singletonRef_s); return singletonRef_s->bIsClient_; }68 static bool isStandalone() { assert(singletonRef_s); return singletonRef_s->bIsStandalone_; }69 static bool isMaster() { assert(singletonRef_s); return singletonRef_s->bIsMaster_; }70 71 59 private: 72 // GSRoot has access to these73 static void setShowsGraphics(bool val) { assert(singletonRef_s); singletonRef_s->bShowsGraphics_ = val; singletonRef_s->updateIsMaster(); }74 static void setHasServer (bool val) { assert(singletonRef_s); singletonRef_s->bHasServer_ = val; singletonRef_s->updateIsMaster(); }75 static void setIsClient (bool val) { assert(singletonRef_s); singletonRef_s->bIsClient_ = val; singletonRef_s->updateIsMaster(); }76 static void setIsStandalone (bool val) { assert(singletonRef_s); singletonRef_s->bIsStandalone_ = val; singletonRef_s->updateIsMaster(); }77 static void updateIsMaster () { assert(singletonRef_s); singletonRef_s->bIsMaster_ = (singletonRef_s->bHasServer_ || singletonRef_s->bIsStandalone_); }78 79 60 Settings(); 80 61 Settings(const Settings& instance); … … 87 68 void setConfigValues(); 88 69 89 bool bShowsGraphics_; //!< global variable that tells whether to show graphics90 bool bHasServer_; //!< global variable that tells whether this is a server91 bool bIsClient_;92 bool bIsStandalone_;93 bool bIsMaster_;94 95 70 std::string dataPath_; //!< Path to the game data 96 71
Note: See TracChangeset
for help on using the changeset viewer.