Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 11, 2010, 12:34:00 AM (15 years ago)
Author:
landauf
Message:

merged doc branch back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/GameMode.h

    r6417 r7401  
    2929/**
    3030    @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.
    3233*/
    3334
     
    4041namespace orxonox
    4142{
     43    /// Helper class, stores and returns the current mode of the game.
    4244    class _CoreExport GameMode
    4345    {
     
    4749        public:
    4850// 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)
    5557// tolua_end
    5658
    57             static void setPlaysSound   (bool val) { bPlaysSound_s    = val; }
    58             static void setHasServer    (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)
    6163
    6264        private:
     
    6567            ~GameMode();
    6668
     69            /// Checks if we're in control of the game (either standalone or server).
    6770            static void updateIsMaster()
    6871            {
    69                 bIsMaster_s = (bHasServer_s || bIsStandalone_s);
     72                bIsMaster_s = (bIsServer_s || bIsStandalone_s);
    7073            }
    7174
    7275            static bool bShowsGraphics_s;                   //!< global variable that tells whether to show graphics
    7376            static bool bPlaysSound_s;                      //!< global variable that tells whether to sound works
    74             static bool bHasServer_s;                       //!< global variable that tells whether this is a server
    75             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)
    7881    }; // tolua_export
    7982} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.