blob: bc32f551b723c8f5a965bc64a7d884834d700a3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#ifndef GAME_BUILDER_H
#define GAME_BUILDER_H
#include <bu/string.h>
#include "variable.h"
#include "astnode.h"
class GameBuilder
{
public:
GameBuilder();
virtual ~GameBuilder();
void setLiteral( const Variable &v );
void setGameParam( const Bu::String &sName );
void beginFunction( const Bu::String &sName );
void addFunctionParam( const Bu::String &sName );
void endFunction();
void beginSituation( const Bu::String &sName );
void endSituation();
void addNode( AstNode::Type iType );
void closeNode();
void addLiteral( const Variable &v );
void addVarRef( const Bu::String &sName );
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 closeCommand();
private:
class Game *pGame;
bool bGlobal;
Variable vLiteral;
class AstBranch *pCurNode;
class AstBranch *pCurRoot;
class Command *pCurCmd;
class AstFunction *pCurFnc;
};
#endif
|