public void StartGame(Nou p1, IArtificialIntelligence p2) { P1 = p1; P2 = p2; if (Game != null) { Game.PropertyChanged -= Game_PropertyChanged; Game.SyncRequired -= Game_SyncRequired; } Round = 0; Game = new LocalGame(); Game.SetAi(p1, 1); Game.SetAi(p2, 2); Game.InitGame(); Game.AiCommandDelay = AiDelay; Game.PropertyChanged += Game_PropertyChanged; Game.SyncRequired += Game_SyncRequired; NeedsUiUpdate?.Invoke(this, EventArgs.Empty); ++Round; Task.Run(async() => await Game.AiPlayer1Move()); }