public void ChangeMainEngine(UCIEngine engine) { this.Game.DefaultEngine.Pause(); this.Game.SwapPlayersIfNeeded(); if (this.Game.IsDefaultEngine(engine)) { this.Game.DefaultEngine.Resume(); return; } this.Game.Clock.Stop(); this.Game.PreviousPonderMove = ""; this.Game.DefaultEngine.Close(); this.Game.DefaultEngine = engine; AnalysisUc.ChangeEngine(engine); AnalysisUc.TabText = engine.EngineTitle; if (this.Game.GameMode == App.Model.GameMode.HumanVsEngine) { if (this.Game.CurrentPlayer.IsWhite) { this.Game.Player2.Engine = this.Game.DefaultEngine; } else { this.Game.Player1.Engine = this.Game.DefaultEngine; } ChessBoardUc.SetEvents(); this.Game.GameData.Black1 = this.Game.DefaultEngine.EngineName; this.RefreshGameInfo(); } }