src/Variables.h

changeset 101
9ffae10ef76f
parent 88
5def6ff8b466
equal deleted inserted replaced
100:e0392814ee31 101:9ffae10ef76f
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 }

mercurial