diff options
Diffstat (limited to 'src/gamestate.h')
| -rw-r--r-- | src/gamestate.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gamestate.h b/src/gamestate.h index 2754873..cb02322 100644 --- a/src/gamestate.h +++ b/src/gamestate.h | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | #ifndef GAME_STATE_H | 1 | #ifndef GAME_STATE_H |
| 2 | #define GAME_STATE_H | 2 | #define GAME_STATE_H |
| 3 | 3 | ||
| 4 | #include "astbranch.h" | ||
| 5 | #include "variable.h" | ||
| 6 | #include "scope.h" | ||
| 7 | |||
| 4 | class Game; | 8 | class Game; |
| 5 | 9 | ||
| 6 | class GameState | 10 | class GameState |
| @@ -9,8 +13,25 @@ public: | |||
| 9 | GameState( Game *pGame ); | 13 | GameState( Game *pGame ); |
| 10 | virtual ~GameState(); | 14 | virtual ~GameState(); |
| 11 | 15 | ||
| 16 | void parse( class AstBranch *pAst ); | ||
| 17 | |||
| 18 | Variable pop() { return lStack.peekPop(); } | ||
| 19 | void push( const Variable &v ) { lStack.push( v ); } | ||
| 20 | |||
| 21 | void callFunction( const Bu::String &sName ); | ||
| 22 | |||
| 12 | private: | 23 | private: |
| 24 | void parse( const AstBranch::NodeList &lCode ); | ||
| 25 | |||
| 26 | private: | ||
| 27 | typedef Bu::List<Scope *> ScopeList; | ||
| 28 | typedef Bu::Hash<Bu::String, Scope *> ScopeHash; | ||
| 13 | Game *pGame; | 29 | Game *pGame; |
| 30 | Scope sGlobal; | ||
| 31 | ScopeList lsLocal; | ||
| 32 | ScopeHash hsSituation; | ||
| 33 | |||
| 34 | VariableList lStack; | ||
| 14 | }; | 35 | }; |
| 15 | 36 | ||
| 16 | #endif | 37 | #endif |
