Implements variable usage, tweaks and fixes for variable assignment

This commit is contained in:
2019-05-30 15:23:48 +02:00
parent 257eb942c7
commit 6fad5a0a7d
17 changed files with 145 additions and 4 deletions

View File

@@ -9,12 +9,15 @@
class EvaluationScope {
unordered_map<int, EvalValue*>* _scriptScope;
vector<unordered_map<int, EvalValue*>> _localScope;
int _currentScope;
public:
explicit EvaluationScope(unordered_map<int, EvalValue*>* scriptVariables, int deepestScope);
~EvaluationScope();
void CreateVariable(int scope, int id, EvalValue* value);
void SetVariable(int scope, int id, EvalValue* value);
void OuterScope();
void InnerScope();
EvalValue* GetVariable(int scope, int id);
};