ChessBoardVisualLib.ViewModel.SquareItem.SetBackgroundColor C# (CSharp) 메소드

SetBackgroundColor() 공개 메소드

public SetBackgroundColor ( Square square ) : void
square Square
리턴 void
        public void SetBackgroundColor(Square square)
        {
            int file = (int)BitBoardHelper.GetFileFromSquare(square);
            int rank = BitBoardHelper.GetRankFromSquare(square);

            if (0 == ((7 - file) + rank) % 2)
                this.SquareColor = Color.White;
            else
                this.SquareColor = Color.Black;
        }