public void GameRound(Move i_CurrentMove) { i_CurrentMove.FromSquare = m_BoardGame.GetSquare(i_CurrentMove.FromSquare.Row, i_CurrentMove.FromSquare.Column); i_CurrentMove.ToSquare = m_BoardGame.GetSquare(i_CurrentMove.ToSquare.Row, i_CurrentMove.ToSquare.Column); if (this.m_GameStatus == eGameStatus.NotFinished) { if (v_Turn) { playCurrentPlayerTurn(i_CurrentMove, m_Player1, m_Player2); } else { if (m_Player2.PlayerType == Player.ePlayerType.Person) { playCurrentPlayerTurn(i_CurrentMove, m_Player2, m_Player1); } } checkGameStatus(); if (this.m_GameStatus == eGameStatus.NotFinished) { if (!v_Turn) { if (m_Player2.PlayerType == Player.ePlayerType.Computer) { PlayComputerTurn(); } } } } checkGameStatus(); if (this.m_GameStatus != eGameStatus.NotFinished) { if (this.m_GameStatus == eGameStatus.Winner) { EndGameRound.Invoke(Player1, EventArgs.Empty); } else { EndGameRound.Invoke(Player2, EventArgs.Empty); } } }
public void GameRound(Move i_CurrentMove) { i_CurrentMove.CurrentPiece = r_GameTable.GetSolider(i_CurrentMove.CurrentPiece.Row, i_CurrentMove.CurrentPiece.Column); i_CurrentMove.TargetPiece = r_GameTable.GetSolider(i_CurrentMove.TargetPiece.Row, i_CurrentMove.TargetPiece.Column); if (this.r_GameStatus.m_StatusType == GameStatus.eGameStatus.StillPlaying) { if (v_TurnPlayer1) { playCurrentPlayerTurn(i_CurrentMove, r_Player1, r_Player2); } else { if (r_Player2.PlayerType == Player.ePlayerType.Person) { playCurrentPlayerTurn(i_CurrentMove, r_Player2, r_Player1); } } checkGameStatus(); if (this.r_GameStatus.m_StatusType == GameStatus.eGameStatus.StillPlaying) { if (!v_TurnPlayer1) { if (r_Player2.PlayerType == Player.ePlayerType.Computer) { PlayComputerTurn(); } } } } checkGameStatus(); if (this.r_GameStatus.m_StatusType != GameStatus.eGameStatus.StillPlaying) { if (this.r_GameStatus.m_StatusType == GameStatus.eGameStatus.Winner) { EndGameRound.Invoke(GetPlayer1(), EventArgs.Empty); } else { EndGameRound.Invoke(GetPlayer2(), EventArgs.Empty); } } }