/// <inheritdoc/> protected override void OnClose() { // Shutdown GUI system _dialogRenderer?.Dispose(); _guiManager?.Dispose(); base.OnClose(); }
void IDisposable.Dispose() { lock (syncRoot) { if (root != null) { root.Dispose(); window.Dispose(); window = null; root = null; } } }
protected override void Dispose(bool disposing) { try { if (disposing) { if (_guiManager != null) { _guiManager.Dispose(); } } } finally { base.Dispose(disposing); } }
public void Dispose() { Gui.Dispose(); }
public void ChangeState(int state) { //Title screen state if (state == GameCore.STATE_TITLE) { UnloadGame(); GameState = GameCore.STATE_TITLE; if (highScoresGui != null) { highScoresGui.Dispose(); } titleGui = GuiFactory.CreateTitleGui(this, titleGui, inputManager); } //Play the game state else if (state == GameCore.STATE_GAME) { LoadGame(); GameState = GameCore.STATE_GAME; titleGui.Dispose(); } //Show the high scores state else if (state == GameCore.STATE_SCORES) { UnloadGame(); GameState = GameCore.STATE_SCORES; titleGui.Dispose(); if (inputHighScoreGui != null) { inputHighScoreGui.Dispose(); } highScoresGui = GuiFactory.CreateHighScoresGui(this, highScoresGui, inputManager); SortHighScores(); } //Game over state else if (state == GameCore.STATE_GAMEOVER) { score = World.Score; UnloadGame(); var addTo = false; foreach (HighScore scoreData in HighScoreData) { if (score > scoreData.Score) { addTo = true; break; } } if (HighScoreData.Count < 10) { addTo = true; } if (addTo) { ChangeState(GameCore.STATE_INPUTSCORE); } else { ChangeState(GameCore.STATE_SCORES); } } else if (state == GameCore.STATE_INPUTSCORE) { GameState = GameCore.STATE_INPUTSCORE; inputHighScoreGui = GuiFactory.CreateInputHighScoreGui(this, inputHighScoreGui, inputManager); } }