Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 18, 2008, 9:17:30 PM (16 years ago)
Author:
rgrieder
Message:

started implementing the GameStates. Not much for now, but most of the Orxonox.cc code has been copied to GSRoot, GSGraphics and GSLevel.
There is no level currently, but the main menu is shown. This is more of an svn save because I would really like to have Member ConsoleCommands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/GameState.h

    r1660 r1661  
    6262    public:
    6363        GameState(const std::string& name);
    64         virtual ~GameState() { }
     64        virtual ~GameState();
    6565
    6666        const std::string& getName() const { return name_; }
    6767
    6868        void addChild(GameState* state);
     69        void removeChild(GameState* state);
     70        void removeChild(const std::string& name);
    6971        void requestState(const std::string& name);
    7072
     
    7678        bool isCurrentState() { return this->bActive_ && !this->activeChild_; }
    7779
     80        virtual bool tick(float dt) { return true; }
     81
    7882    protected:
     83        //virtual void enter() = 0;
     84        //virtual void leave() = 0;
     85        //virtual void tick(float dt) = 0;
    7986        virtual void enter() { }
    8087        virtual void leave() { }
    81         virtual void tick(float dt) { }
     88
     89        GameState* getActiveChild() { return this->activeChild_; }
    8290
    8391    private:
     
    8694        GameState* getRootNode();
    8795        void grandchildAdded(GameState* child, GameState* grandchild);
     96        void grandchildRemoved(GameState* grandchild);
    8897        void makeTransition(GameState* state);
    8998        void activate();
Note: See TracChangeset for help on using the changeset viewer.