#ifndef GAME_BUILDER_H #define GAME_BUILDER_H #include #include "variable.h" #include "astnode.h" #include "situation.h" class GameBuilder { public: GameBuilder(); virtual ~GameBuilder(); class Game *getGame() { return pGame; } void setLiteral( const Variable &v ); void setGameParam( const Bu::String &sName ); void beginFunction( const Bu::String &sName ); void addFunctionParam( const Bu::String &sName ); void endFunctionParams(); void endFunction(); void beginSituation( const Bu::String &sName ); void beginSituationMode( Situation::Mode m ); void closeSituationMode(); void endSituation(); void addNode( AstNode::Type iType ); void closeNode(); void addLiteral( const Variable &v ); void addVarRef( const Bu::String &sName, ScopeId sid ); void addFuncCall( const Bu::String &sName ); void beginGlobal(); void closeGlobal(); void beginCommand( const Bu::String &sValue ); void addCommandLiteral( const Bu::String &sValue ); void addCommandParam( const Bu::String &sValue ); void endCommandParams(); void closeCommand(); private: class Game *pGame; bool bGlobal; Variable vLiteral; class AstBranch *pCurNode; class AstBranch *pCurRoot; class Command *pCurCmd; class AstFunction *pCurFnc; class Situation *pCurSit; Situation::Mode eCurSitMode; }; #endif