private async Task StartGame(GameBoard board) { _tramsformer = new ToCanvasTramsformer(objectSize, HeigthSlider.Value, WidthSlider.Value, GamePanel.ActualHeight, GamePanel.ActualWidth); ClrearBoard(); board.OnPieceMove += OnPieceMove; CreatePlayers(board.State); _engine = new GameEngine(board, (int)Speed.Value); await _engine.StartGame(); }
private void GamePanel_SizeChanged(object sender, SizeChangedEventArgs e) { _tramsformer = new ToCanvasTramsformer(objectSize, HeigthSlider.Value, WidthSlider.Value, e.NewSize.Height, e.NewSize.Width); }