SteamWar/BauSystem2.0
Archiviert
12
0

Update ScriptExecutor
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-01-02 22:14:20 +01:00
Ursprung bf4bde9978
Commit 9f1c790199

Datei anzeigen

@ -152,18 +152,22 @@ public final class ScriptExecutor {
variables.addAll(Constants.allVariables()); variables.addAll(Constants.allVariables());
variables.addAll(globalVariables.allVariables()); variables.addAll(globalVariables.allVariables());
for (int i = 0; i < 2; i++) { for (int i = 0; i < 3; i++) {
for (String variable : variables) { for (String variable : variables) {
s = s.replace("<" + variable + ">", getValue(variable) + ""); s = s.replace("<" + variable + ">", getValue(variable));
s = s.replace("<" + variable + ".type>", getOrItselfValue(variable).type());
} }
for (String constVariable : Constants.allVariables()) { for (String constVariable : Constants.allVariables()) {
s = s.replace("<const." + constVariable + ">", getConstant(constVariable) + ""); s = s.replace("<const." + constVariable + ">", getConstant(constVariable));
s = s.replace("<const." + constVariable + ".type>", Constants.getConstant(constVariable, player).type());
} }
for (String localVariable : localVariables.allVariables()) { for (String localVariable : localVariables.allVariables()) {
s = s.replace("<local." + localVariable + ">", getLocal(localVariable) + ""); s = s.replace("<local." + localVariable + ">", getLocal(localVariable));
s = s.replace("<local." + localVariable + ".type>", getLocalVariables().getValue(localVariable).type());
} }
for (String globalVariable : globalVariables.allVariables()) { for (String globalVariable : globalVariables.allVariables()) {
s = s.replace("<global." + globalVariable + ">", getGlobal(globalVariable) + ""); s = s.replace("<global." + globalVariable + ">", getGlobal(globalVariable));
s = s.replace("<global." + globalVariable + ".type>", globalVariables.getValue(globalVariable).type());
} }
} }
return s.split(" "); return s.split(" ");
@ -220,7 +224,7 @@ public final class ScriptExecutor {
if (localVariables.hasValue(variable)) { if (localVariables.hasValue(variable)) {
return localVariables.getValue(variable).asString(); return localVariables.getValue(variable).asString();
} }
return "0"; return "";
} }
public String getConstant(String variable) { public String getConstant(String variable) {