public void StartGame() { curPlayerIndex = 0; CurPlayer = Players[curPlayerIndex]; PieceController.UpdateMoves(CurPlayer); CurPlayer.TakeTurn(); }
public void Update() { Move move = CurPlayer.GetMove(GetValidMoves()); if (IsValidMove(move)) { MakeMove(move); UpdateView(); CurPlayer = NextPlayer(); if (CheckWin()) { CurPlayer = NextPlayer(); MessageBox.Show("Player:" + CurPlayer.PiecesColor + " wins!"); ResetGame(); } else { PieceController.UpdateMoves(CurPlayer); CurPlayer.TakeTurn(); } } else { MessageBox.Show("Invalid move!"); ViewController.ClearSquares(); } }