コード例 #1
0
ファイル: GameManager.cs プロジェクト: omerMorag/Othello
        private Player getWinner(out string o_Score)
        {
            Player winner = null; // if its a tie, we return null

            m_CurrentGame.UpdatePlayerScore(m_BlackPlayer);
            m_CurrentGame.UpdatePlayerScore(m_WhitePlayer);
            o_Score = String.Format("{0}/{1}", m_BlackPlayer.Score, m_WhitePlayer.Score);

            if (m_BlackPlayer.Score > m_WhitePlayer.Score)
            {
                winner = m_BlackPlayer;
                m_BlackPlayerScore++;
            }
            else if (m_WhitePlayer.Score > m_BlackPlayer.Score)
            {
                winner  = m_WhitePlayer;
                o_Score = String.Format("{0}/{1}", m_WhitePlayer.Score, m_BlackPlayer.Score);
                m_WhitePlayerScore++;
            }

            return(winner);
        }