summaryrefslogtreecommitdiff
path: root/src/game.h
blob: 7dc445f4d8d7141061dc5f0a7e36140182690119 (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
#ifndef GAME_H
#define GAME_H

#include <bu/string.h>
#include <bu/hash.h>

#include "function.h"
#include "situation.h"
#include "scope.h"
#include "commandset.h"

class Game
{
friend class GameBuilder;
public:
	Game();
	virtual ~Game();

	typedef Bu::Hash<Bu::String, Function *> FunctionHash;
	typedef Bu::Hash<Bu::String, Situation *> SituationHash;

	Function *getFunction( const Bu::String &sName );
	Variable getParam( const Bu::String &sName ) const;
	Situation *getSituation( const Bu::String &sName );

	const FunctionHash &getFunctionHash() const { return hFunction; }

	bool execCommand( class GameState &gState, const Bu::StringList &lCmd );

private:
	void addFunction( Function *pFunc );

private:
	VariableHash hGlobalParam;
	FunctionHash hFunction;
	SituationHash hSituation;
	CommandSet csGlobal;
};

#endif