internal StoryState(Story story) { this.story = story; _outputStream = new List <Runtime.Object> (); OutputStreamDirty(); evaluationStack = new List <Runtime.Object> (); callStack = new CallStack(story.rootContentContainer); variablesState = new VariablesState(callStack, story.listDefinitions); visitCounts = new Dictionary <string, int> (); turnIndices = new Dictionary <string, int> (); currentTurnIndex = -1; // Seed the shuffle random numbers int timeSeed = DateTime.Now.Millisecond; storySeed = (new Random(timeSeed)).Next() % 100; previousRandom = 0; _currentChoices = new List <Choice> (); GoToStart(); }
public StoryState(Story story) { this.story = story; _currentFlow = new Flow(kDefaultFlowName, story); OutputStreamDirty(); evaluationStack = new List <Runtime.Object> (); variablesState = new VariablesState(callStack, story.listDefinitions); _visitCounts = new Dictionary <string, int> (); _turnIndices = new Dictionary <string, int> (); currentTurnIndex = -1; // Seed the shuffle random numbers int timeSeed = DateTime.Now.Millisecond; storySeed = (new Random(timeSeed)).Next() % 100; previousRandom = 0; GoToStart(); }
internal void CopyFrom(VariablesState varState) { _globalVariables = new Dictionary <string, Object> (varState._globalVariables); variableChangedEvent = varState.variableChangedEvent; if (varState.batchObservingVariableChanges != batchObservingVariableChanges) { if (varState.batchObservingVariableChanges) { _batchObservingVariableChanges = true; _changedVariables = new HashSet <string> (varState._changedVariables); } else { _batchObservingVariableChanges = false; _changedVariables = null; } } }
internal void CopyFrom(VariablesState toCopy) { _globalVariables = new Dictionary <string, Object> (toCopy._globalVariables); // It's read-only, so no need to create a new copy _defaultGlobalVariables = toCopy._defaultGlobalVariables; variableChangedEvent = toCopy.variableChangedEvent; if (toCopy.batchObservingVariableChanges != batchObservingVariableChanges) { if (toCopy.batchObservingVariableChanges) { _batchObservingVariableChanges = true; _changedVariables = new HashSet <string> (toCopy._changedVariables); } else { _batchObservingVariableChanges = false; _changedVariables = null; } } }