Changeset 7401 for code/trunk/src/libraries/core/GameMode.h
- Timestamp:
- Sep 11, 2010, 12:34:00 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/doc (added) merged: 7290-7292,7296-7300,7302-7304,7306-7312,7315-7318,7323,7325,7327,7331-7332,7334-7335,7345-7347,7352-7353,7356-7357,7361,7363-7367,7371-7375,7388
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/GameMode.h
r6417 r7401 29 29 /** 30 30 @file 31 @brief Declaration of the GameMode class. 31 @ingroup Management CoreGame 32 @brief Declaration of the GameMode class which stores and returns the current mode of the game. 32 33 */ 33 34 … … 40 41 namespace orxonox 41 42 { 43 /// Helper class, stores and returns the current mode of the game. 42 44 class _CoreExport GameMode 43 45 { … … 47 49 public: 48 50 // tolua_begin 49 static bool showsGraphics() { return bShowsGraphics_s; } 50 static bool playsSound() { return bPlaysSound_s; } 51 static bool hasServer() { return bHasServer_s; }52 static bool isClient() { return bIsClient_s; } 53 static bool isStandalone() { return bIsStandalone_s; } 54 static bool isMaster() { return bIsMaster_s; } 51 static bool showsGraphics() { return bShowsGraphics_s; } ///< Returns true if the game shows graphics, false if it is in text-console mode 52 static bool playsSound() { return bPlaysSound_s; } ///< Returns true if the game is able to play sounds 53 static bool isServer() { return bIsServer_s; } ///< Returns true if we're currently a server (online) 54 static bool isClient() { return bIsClient_s; } ///< Returns true if we're currently a client (online) 55 static bool isStandalone() { return bIsStandalone_s; } ///< Returns true if we're in standalone mode (offline) 56 static bool isMaster() { return bIsMaster_s; } ///< Returns true if we're in control of the game (either standalone or server) 55 57 // tolua_end 56 58 57 static void setPlaysSound (bool val) { bPlaysSound_s = val; } 58 static void set HasServer (bool val) { bHasServer_s = val; updateIsMaster(); }59 static void setIsClient (bool val) { bIsClient_s = val; updateIsMaster(); } 60 static void setIsStandalone (bool val) { bIsStandalone_s = val; updateIsMaster(); } 59 static void setPlaysSound (bool val) { bPlaysSound_s = val; } ///< Defines if the game can play sounds 60 static void setIsServer (bool val) { bIsServer_s = val; updateIsMaster(); } ///< Defines if the program is in server mode (online) 61 static void setIsClient (bool val) { bIsClient_s = val; updateIsMaster(); } ///< Defines if the program is in client mode (online) 62 static void setIsStandalone (bool val) { bIsStandalone_s = val; updateIsMaster(); } ///< Defines if the program is in standalone mode (offline) 61 63 62 64 private: … … 65 67 ~GameMode(); 66 68 69 /// Checks if we're in control of the game (either standalone or server). 67 70 static void updateIsMaster() 68 71 { 69 bIsMaster_s = (b HasServer_s || bIsStandalone_s);72 bIsMaster_s = (bIsServer_s || bIsStandalone_s); 70 73 } 71 74 72 75 static bool bShowsGraphics_s; //!< global variable that tells whether to show graphics 73 76 static bool bPlaysSound_s; //!< global variable that tells whether to sound works 74 static bool b HasServer_s; //!< global variable that tells whether this is a server75 static bool bIsClient_s; 76 static bool bIsStandalone_s; 77 static bool bIsMaster_s; 77 static bool bIsServer_s; //!< global variable that tells whether this is a server (online) 78 static bool bIsClient_s; //!< global variable that tells whether this is a client (online) 79 static bool bIsStandalone_s; //!< global variable that tells whether the game is running in standalone mode (offline) 80 static bool bIsMaster_s; //!< global variable that tells whether we're in control of the game (standalone or server) 78 81 }; // tolua_export 79 82 } // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.