/// <summary> /// Exits the game. This must always be called from <see cref="InputThread"/>. /// </summary> private void exit() { // exit() may be called without having been scheduled from Exit(), so ensure the correct exiting state executionState = ExecutionState.Stopping; Window?.Close(); stopAllThreads(); executionState = ExecutionState.Stopped; }
public void Exit() { exitInitiated = true; InputThread.Scheduler.Add(delegate { Window?.Close(); stopAllThreads(); exitCompleted = true; }, false); }