Reversi.ReversiBoard.InverseColor C# (CSharp) Method

InverseColor() static public method

駒の色と逆の色を返す
static public InverseColor ( ReversiColor color ) : ReversiColor
color ReversiColor 駒の色
return ReversiColor
		static public ReversiColor InverseColor(ReversiColor color)
		{
			if(color == ReversiColor.Black) return ReversiColor.White;
			if(color == ReversiColor.White) return ReversiColor.Black;
			return color;
		}

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// 対人戦時、セル(x,y)がクリックされたときの処理
        /// </summary>
        protected void OnCellClick(int x, int y)
        {
            if (!this.board.Check(x, y, this.phase))
            {
                return;
            }

            this.board[x, y] = this.phase;
            this.panel.UpdateBoard();
            this.phase = ReversiBoard.InverseColor(this.phase);
            ShowPhaseMessage();
            if (!this.board.CheckAll(this.phase))
            {
                GameSet();
            }
        }