private void StopScenario(Boolean guiInitiated) { if (guiInitiated) { if (scenarioState != ScenarioState.STOPPED) { WriteScoreSummary(); } } scenarioState = ScenarioState.STOPPED; replayState = ScenarioState.STOPPED; simEngine.StopScenario(); isReady = false; }