Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 19, 2008, 2:24:33 PM (16 years ago)
Author:
rgrieder
Message:

Moved all showsGraphics, hasServer, etc. functions from Settings class to Core class.
This was necessary to avoid circular dependencies.

Location:
code/branches/objecthierarchy/src/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/core/Core.cc

    r1762 r1949  
    3737#include "CoreIncludes.h"
    3838#include "ConfigValueIncludes.h"
    39 //#include "input/InputManager.h"
    40 //#include "TclThreadManager.h"
    4139
    4240namespace orxonox
    4341{
     42    bool Core::bShowsGraphics_s = false;
     43    bool Core::bHasServer_s     = false;
     44    bool Core::bIsClient_s      = false;
     45    bool Core::bIsStandalone_s  = false;
     46    bool Core::bIsMaster_s      = false;
     47
    4448    /**
    4549        @brief Constructor: Registers the object and sets the config-values.
     
    205209        ResetConfigValue(language_);
    206210    }
    207 
    208     ///**
    209     //    @brief Ticks every core class in a specified sequence. Has to be called
    210     //           every Orxonox tick!
    211     //    @param dt Delta Time
    212     //*/
    213     //void Core::tick(float dt)
    214     //{
    215     //    TclThreadManager::getInstance().tick(dt);
    216     //    InputManager::getInstance().tick(dt);
    217     //}
    218211}
  • code/branches/objecthierarchy/src/core/Core.h

    r1755 r1949  
    6060            static void resetLanguage();
    6161
    62             //static void tick(float dt);
     62            // fast access global variables.
     63            static bool showsGraphics() { return bShowsGraphics_s; }
     64            static bool hasServer()     { return bHasServer_s; }
     65            static bool isClient()      { return bIsClient_s; }
     66            static bool isStandalone()  { return bIsStandalone_s; }
     67            static bool isMaster()      { return bIsMaster_s; }
     68            static void setShowsGraphics(bool val) { bShowsGraphics_s = val; updateIsMaster(); }
     69            static void setHasServer    (bool val) { bHasServer_s     = val; updateIsMaster(); }
     70            static void setIsClient     (bool val) { bIsClient_s      = val; updateIsMaster(); }
     71            static void setIsStandalone (bool val) { bIsStandalone_s  = val; updateIsMaster(); }
     72            static void updateIsMaster  ()         { bIsMaster_s      = (bHasServer_s || bIsStandalone_s); }
    6373
    6474        private:
     
    7484            int softDebugLevelShell_;                       //!< The debug level for the ingame shell
    7585            std::string language_;                          //!< The language
     86
     87            static bool bShowsGraphics_s;                   //!< global variable that tells whether to show graphics
     88            static bool bHasServer_s;                       //!< global variable that tells whether this is a server
     89            static bool bIsClient_s;
     90            static bool bIsStandalone_s;
     91            static bool bIsMaster_s;
    7692    };
    7793}
Note: See TracChangeset for help on using the changeset viewer.