private void boardCell_OccupyingPlayerChanged(object i_Sender, EventArgs i_EventArgs) { BoardCell currentBoardCell = (BoardCell)i_Sender; int row = currentBoardCell.Row; int column = currentBoardCell.Column; GraphicBoardCell.eBoardCellType currentBoardCellType = getBoardCellTypeFromOccupyingPlayer(currentBoardCell.OccupyingPlayer); r_BoardMatrix[row, column].SetImage(currentBoardCellType); r_BoardMatrix[row, column].Enabled = false; }
private GraphicBoardCell.eBoardCellType getGraphicBoardCellType(int i_Row, int i_Column) { GraphicBoardCell.eBoardCellType newCellType = GraphicBoardCell.eBoardCellType.Empty; if (r_GameLogic.CurrentGameState.GameBoard[i_Row, i_Column].OccupyingPlayer == Player.ePlayerNumber.Player1) { newCellType = GraphicBoardCell.eBoardCellType.BlackPlayer; } else if (r_GameLogic.CurrentGameState.GameBoard[i_Row, i_Column].OccupyingPlayer == Player.ePlayerNumber.Player2) { newCellType = GraphicBoardCell.eBoardCellType.WhitePlayer; } return(newCellType); }
private GraphicBoardCell.eBoardCellType getBoardCellTypeFromOccupyingPlayer(Player.ePlayerNumber i_OccupyingPlayer) { GraphicBoardCell.eBoardCellType cellType = GraphicBoardCell.eBoardCellType.Empty; switch (i_OccupyingPlayer) { case Player.ePlayerNumber.None: cellType = GraphicBoardCell.eBoardCellType.Empty; break; case Player.ePlayerNumber.Player1: cellType = GraphicBoardCell.eBoardCellType.BlackPlayer; break; case Player.ePlayerNumber.Player2: cellType = GraphicBoardCell.eBoardCellType.WhitePlayer; break; } return(cellType); }