public void ApplyPatch() { foreach (var namedVar in patch.globals) { _globalVariables[namedVar.Key] = namedVar.Value; } patch = null; }
public void ApplyPatch() { foreach (var namedVar in patch.globals) { _globalVariables[namedVar.Key] = namedVar.Value; } if (_changedVariablesForBatchObs != null) { foreach (var name in patch.changedVariables) { _changedVariablesForBatchObs.Add(name); } } patch = null; }
public StatePatch(StatePatch toCopy) { if (toCopy != null) { _globals = new Dictionary <string, Object>(toCopy._globals); _changedVariables = new HashSet <string>(toCopy._changedVariables); _visitCounts = new Dictionary <Container, int>(toCopy._visitCounts); _turnIndices = new Dictionary <Container, int>(toCopy._turnIndices); } else { _globals = new Dictionary <string, Object>(); _changedVariables = new HashSet <string>(); _visitCounts = new Dictionary <Container, int>(); _turnIndices = new Dictionary <Container, int>(); } }