]> git.localhorst.tv Git - l2e.git/blob - src/common/Script.h
made vector components writable
[l2e.git] / src / common / Script.h
1 /*
2  * Script.h
3  *
4  *  Created on: Oct 13, 2012
5  *      Author: holy
6  */
7
8 #ifndef COMMON_SCRIPT_H_
9 #define COMMON_SCRIPT_H_
10
11 #include <SDL.h>
12
13 namespace common {
14
15 class Script {
16
17 public:
18         Script();
19         ~Script();
20
21         enum Command {
22                 COMMAND_NOOP,
23                 COMMAND_MOVE,
24                 COMMAND_ADD,
25                 COMMAND_MOD,
26                 COMMAND_RAND,
27                 COMMAND_CMP,
28                 COMMAND_JMP,
29                 COMMAND_JEQ,
30                 COMMAND_JNE,
31                 COMMAND_JL,
32                 COMMAND_JLE,
33                 COMMAND_JG,
34                 COMMAND_JGE,
35                 COMMAND_SYSC,
36         };
37
38         enum Type {
39                 TYPE_NONE,
40                 TYPE_ADDRESS,
41                 TYPE_INTEGER,
42                 TYPE_VECTOR,
43         };
44
45         struct Code {
46                 Command command : 6;
47                 unsigned int numParams : 2;
48                 Type type : 2;
49                 unsigned int reg1 : 3;
50                 unsigned int reg2 : 3;
51         };
52
53 public:
54         const char *text;
55         int textlen;
56
57 };
58
59 }
60
61 #endif /* COMMON_SCRIPT_H_ */