public void CloseEngines() { if (Player1 != null && Player1.Engine != null) { Player1.Engine.Close(); Player1.Engine = null; } if (Player2 != null && Player2.Engine != null) { Player2.Engine.Close(); Player2.Engine = null; } if (CurrentPlayer != null && CurrentPlayer.Engine != null) { CurrentPlayer.Engine.Close(); CurrentPlayer.Engine = null; } if (DefaultEngine != null) { DefaultEngine.Close(); DefaultEngine = null; } }