blob: cc4999619bfc72328de8f6d006a5fec9d59171e3 (
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
|
#ifndef COMMAND_H
#define COMMAND_H
#include <bu/string.h>
class Command
{
public:
Command();
virtual ~Command();
Bu::String getRoot() const { return lChunks.first().sValue; }
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
|