private void PlayButton_Click(object sender, RoutedEventArgs e) { if (!Validation()) { return; } Close(); Player whitePlayer = new Player { Color = Color.White, Name = WhiteName.Text }; Player blackPlayer = new Player { Color = Color.Black, Name = BlackName.Text }; Board board = TwoRowVersion.IsChecked == true?StandardBoards.Get2v2Board() : StandardBoards.Get3v3Board(); Game game = new Game(whitePlayer, blackPlayer, board); new Chessboard(game).ShowDialog(); }
private void PlayButton_Click(object sender, RoutedEventArgs e) { if (!Validation()) { return; } Close(); var humanPlayer = new Player { Color = WhiteColor.IsChecked == true ? Color.White : Color.Black, Name = HumanName.Text }; var computerPlayer = new ComputerPlayer { Color = WhiteColor.IsChecked == true ? Color.Black : Color.White, Name = ComputerName.Text }; Board board = TwoRowVersion.IsChecked == true?StandardBoards.Get2v2Board() : StandardBoards.Get3v3Board(); Game game = WhiteColor.IsChecked == true ? new Game(humanPlayer, computerPlayer, board) : new Game(computerPlayer, humanPlayer, board); new Chessboard(game).ShowDialog(); }
public void SetUp() { board = StandardBoards.GetEmptyBoard(); }