29 #ifndef BOTC_VARIABLES_H |
29 #ifndef BOTC_VARIABLES_H |
30 #define BOTC_VARIABLES_H |
30 #define BOTC_VARIABLES_H |
31 |
31 |
32 #include "Main.h" |
32 #include "Main.h" |
33 |
33 |
|
34 class ExpressionValue; |
34 class BotscriptParser; |
35 class BotscriptParser; |
35 |
36 |
36 struct ScriptVariable |
37 struct ScriptVariable |
37 { |
38 { |
38 String name; |
39 enum EWritability |
39 String statename; |
40 { |
40 EType type; |
41 WRITE_Mutable, // normal read-many-write-many variable |
41 int value; |
42 WRITE_Const, // write-once const variable |
42 int index; |
43 WRITE_Constexpr, // const variable whose value is known to compiler |
|
44 }; |
|
45 |
|
46 String name; |
|
47 String statename; |
|
48 EType type; |
|
49 int index; |
|
50 EWritability writelevel; |
|
51 int value; |
43 |
52 |
44 inline bool IsGlobal() const |
53 inline bool IsGlobal() const |
45 { |
54 { |
46 return statename.IsEmpty(); |
55 return statename.IsEmpty(); |
47 } |
56 } |