private void cellButton_CheckingGameOver(object i_Sender, CellChosenEventArgs i_E) { Board.Cell.Parse(r_CellButtons[i_E.m_CellIndex].Name, out Board.Cell clickedCell); this.m_IsGameFinished = this.r_GameLogic.CheckEndGame(clickedCell, this.m_CurrentNumOfMoves, this.m_PlayerIndexTurn); if (this.m_IsGameFinished) { byte winnerPlayerIndex = GameLogic.GetOtherPlayerIndex(this.m_PlayerIndexTurn); this.showResults(winnerPlayerIndex); this.resetRound(); } }
internal void RegisterMove(Board.Cell i_CurrentMove, byte i_PlayerIndex) { this.Board[i_CurrentMove] = i_CurrentMove; this.Board[i_CurrentMove].m_CellSign = this.Players[i_PlayerIndex].Sign; if (this.Players[i_PlayerIndex].PlayerType == ePlayerType.Human) { this.Players[i_PlayerIndex].m_MovesList.Add(i_CurrentMove); } CellChosenEventArgs e = new CellChosenEventArgs { m_CellSign = i_CurrentMove.m_CellSign, m_CellIndex = Board.GetCellIndexInBoard(i_CurrentMove) }; OnCellChosen(e); }
protected virtual void OnCellChosen(CellChosenEventArgs e) { this.CellChosen?.Invoke(this, e); }
private void cellButton_PrintingMove(object i_Sender, CellChosenEventArgs i_E) { changeCellButtonAppearance(r_CellButtons[i_E.m_CellIndex], i_E.m_CellSign); BoldCurrentPlayerName(false); }