Rewrite UpgradeManager implementation to suit conditions.

This commit is contained in:
Paul Chote
2016-11-19 16:18:06 +00:00
parent 05187f5828
commit 3f0b33992c
17 changed files with 219 additions and 160 deletions

View File

@@ -222,7 +222,7 @@ namespace OpenRA.Support
return new VariableToken(start, expression.Substring(start));
}
static bool ParseSymbol(VariableToken t, Dictionary<string, bool> symbols)
static bool ParseSymbol(VariableToken t, IReadOnlyDictionary<string, bool> symbols)
{
bool value;
symbols.TryGetValue(t.Symbol, out value);
@@ -271,7 +271,7 @@ namespace OpenRA.Support
yield return s.Pop();
}
public bool Evaluate(Dictionary<string, bool> symbols)
public bool Evaluate(IReadOnlyDictionary<string, bool> symbols)
{
var s = new Stack<bool>();
foreach (var t in postfix)