blob: f82e87e1dd60974109ebc2736a00c261ae269c3a (
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
|
#ifndef COMMAND_H
#define COMMAND_H
#include <bu/string.h>
class Command
{
public:
Command();
virtual ~Command();
void addLiteral( const Bu::String &sValue );
void addParam( const Bu::String &sValue );
/**
* Get the list of parameters IN REVERSE ORDER.
*/
Bu::StringList getParamList() const;
void setAst( class AstBranch *pAst );
void print();
bool matches( const Bu::StringList &lCmd );
void exec( class GameState &gState, const Bu::StringList &lCmd );
private:
class Chunk
{
public:
Chunk( bool bLiteral, const Bu::String &sValue ) :
bLiteral( bLiteral ), sValue( sValue )
{
}
bool bLiteral;
Bu::String sValue;
};
typedef Bu::List<Chunk> ChunkList;
ChunkList lChunks;
class AstBranch *pAst;
};
#endif
|