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/GSIOConsole.cc

    r2817 r2844  
    3636
    3737#include "core/ConsoleCommand.h"
     38#include "core/Game.h"
    3839
    3940namespace orxonox
    4041{
    41     GSIOConsole::GSIOConsole()
    42         : GameState("ioConsole")
     42    AddGameState(GSIOConsole, "ioConsole");
     43
     44    GSIOConsole::GSIOConsole(const std::string& name)
     45        : GameState(name)
    4346    {
    4447    }
     
    4851    }
    4952
    50     void GSIOConsole::enter()
     53    void GSIOConsole::activate()
    5154    {
    5255    }
    5356
    54     void GSIOConsole::leave()
     57    void GSIOConsole::deactivate()
    5558    {
    5659    }
    5760
    58     void GSIOConsole::ticked(const Clock& time)
     61    void GSIOConsole::update(const Clock& time)
    5962    {
    6063        std::string command;
    6164        std::getline(std::cin, command);
    6265        CommandExecutor::execute(command, true);
    63        
    64         tickChild(time);
    6566    }
    6667}
Note: See TracChangeset for help on using the changeset viewer.