SteamWar/BauSystem2.0
Archiviert
12
0

Possibly fix ScriptExecutor
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-04-04 18:33:36 +02:00
Ursprung 36532ccd5d
Commit b8a27294fc

Datei anzeigen

@ -191,30 +191,6 @@ public final class ScriptExecutor {
private String[] replaceExpressions(String s) { private String[] replaceExpressions(String s) {
s = s.replaceAll(" +", " "); s = s.replaceAll(" +", " ");
// TODO: Remove this code as the Expression System below will replace it!
Set<String> variables = new HashSet<>(localVariables.allVariables());
variables.addAll(Constants.allVariables());
variables.addAll(globalVariables.allVariables());
for (int i = 0; i < 3; i++) {
for (String variable : variables) {
s = s.replace("<" + variable + ">", getValue(variable));
s = s.replace("<" + variable + ".type>", getOrItselfValue(variable).type());
}
for (String constVariable : Constants.allVariables()) {
s = s.replace("<const." + constVariable + ">", getConstant(constVariable));
s = s.replace("<const." + constVariable + ".type>", Constants.getConstant(constVariable, player).type());
}
for (String localVariable : localVariables.allVariables()) {
s = s.replace("<local." + localVariable + ">", getLocal(localVariable));
s = s.replace("<local." + localVariable + ".type>", getLocalVariables().getValue(localVariable).type());
}
for (String globalVariable : globalVariables.allVariables()) {
s = s.replace("<global." + globalVariable + ">", getGlobal(globalVariable));
s = s.replace("<global." + globalVariable + ".type>", globalVariables.getValue(globalVariable).type());
}
}
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
int depth = 0; int depth = 0;
StringBuilder st = new StringBuilder(); StringBuilder st = new StringBuilder();