Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1892 for code/branches


Ignore:
Timestamp:
Oct 6, 2008, 10:25:09 PM (16 years ago)
Author:
rgrieder
Message:

Added isClient() function in Settings.

Location:
code/branches/network/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/Settings.cc

    r1755 r1892  
    5151        : bShowsGraphics_(false)
    5252        , bHasServer_(false)
     53        , bIsClient_(false)
    5354    {
    5455        RegisterRootObject(Settings);
  • code/branches/network/src/orxonox/Settings.h

    r1755 r1892  
    5454        friend class GSServer;
    5555        friend class GSDedicated;
     56        friend class GSClient;
    5657
    5758    public:
     
    6465        static bool showsGraphics() { assert(singletonRef_s); return singletonRef_s->bShowsGraphics_; }
    6566        static bool hasServer()     { assert(singletonRef_s); return singletonRef_s->bHasServer_; }
     67        static bool isClient()      { assert(singletonRef_s); return singletonRef_s->bIsClient_; }
    6668
    6769    private:
     
    6971        static void setShowsGraphics(bool val) { assert(singletonRef_s); singletonRef_s->bShowsGraphics_ = val; }
    7072        static void setHasServer    (bool val) { assert(singletonRef_s); singletonRef_s->bHasServer_     = val; }
     73        static void setIsClient     (bool val) { assert(singletonRef_s); singletonRef_s->bIsClient_      = val; }
    7174
    7275        Settings();
     
    8285        bool bShowsGraphics_;                                  //!< global variable that tells whether to show graphics
    8386        bool bHasServer_;                                      //!< global variable that tells whether this is a server
     87        bool bIsClient_;
    8488
    8589        std::string dataPath_;                                 //!< Path to the game data
  • code/branches/network/src/orxonox/gamestates/GSClient.cc

    r1755 r1892  
    3333#include "core/CommandLine.h"
    3434#include "network/Client.h"
     35#include "Settings.h"
    3536
    3637namespace orxonox
     
    5051    void GSClient::enter()
    5152    {
     53        Settings::_getInstance().bIsClient_ = true;
     54
    5255        GSLevel::enter();
    5356
     
    7780
    7881        GSLevel::leave();
     82
     83        Settings::_getInstance().bIsClient_ = false;
    7984    }
    8085
Note: See TracChangeset for help on using the changeset viewer.