Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 25, 2009, 5:23:00 PM (15 years ago)
Author:
rgrieder
Message:

Implemented new GameState concept. It doesn't differ that much from the old one, but there's still lots of changes.
The most important change is that one GameState can occur multiple times in the hierarchy.

Short log:

  • No RootGameState anymore. Simply the highest is root.
  • Game::requestGameState(name) can refer to the parent, grandparent, great-grandparent, etc. or one of the children.
  • Requested states are saved. So if you select "level", the next request (even right after the call) will be relative to "level"
  • Game::popState() will simply unload the current one
  • Re added Main.cc again because Game as well as GameState have been moved to the core
  • Adapted all GameStates to the new system

Things should already work, except for network support because standalone only works with a little hack.
We can now start creating a better hierarchy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/gamestates/GSRoot.h

    r2843 r2844  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    34 #include <list>
    35 #include "core/RootGameState.h"
     33#include "core/GameState.h"
    3634#include "core/OrxonoxClass.h"
    3735
    3836namespace orxonox
    3937{
    40     class _OrxonoxExport GSRoot : public RootGameState
     38    class _OrxonoxExport GSRoot : public GameState
    4139    {
    42         friend class ClassIdentifier<GSRoot>;
     40    public:
     41        GSRoot(const std::string& name);
     42        ~GSRoot();
    4343
    44     public:
    45    
    46     public:
    47         GSRoot();
    48         ~GSRoot();
     44        void activate();
     45        void deactivate();
     46        void update(const Clock& time);
    4947
    5048        // this has to be public because proteced triggers a bug in msvc
     
    5553
    5654    private:
    57         void enter();
    58         void leave();
    59         void ticked(const Clock& time);
    60 
    6155        float                 timeFactor_;       //!< A factor that sets the gamespeed. 1 is normal.
    6256        bool                  bPaused_;
     
    6458
    6559        // console commands
    66         ConsoleCommand*       ccSelectGameState_;
    6760        ConsoleCommand*       ccSetTimeFactor_;
    6861        ConsoleCommand*       ccPause_;
Note: See TracChangeset for help on using the changeset viewer.