summaryrefslogtreecommitdiff
path: root/src/gamebuilder.h
blob: 2637c3753477c133e31da9ae49e8fa1af5fcdaba (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
#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 endFunction();

	void beginSituation( const Bu::String &sName );
	void endSituation();

	void addParam( const Bu::String &sName );
	void addNode( AstNode::Type iType );
	void closeNode();
	void addLiteral( const Variable &v );
	void addVarRef( const Bu::String &sName );

private:
	Variable vLiteral;
	class AstBranch *pCurNode;
	class AstBranch *pCurRoot;

	VariableHash hGameParams;
};

#endif