예제 #1
0
 public Piece(Piece piece)
 {
     Position = new Position(piece.Position);
     Color = piece.Color;
 }
예제 #2
0
 public AIBoardNode(Piece piece)
 {
     Color = piece.Color;
     Row = piece.Position.Row;
     Column = piece.Position.Column;
 }
예제 #3
0
        public bool IsCorner(Piece piece)
        {
            bool isCorner = false;
            int rows = (Tiles.Contains(piece)) ? TileRows : PegRows;

            if ((piece.Position.Row == 0 && piece.Position.Column == 0)
                || (piece.Position.Row == 0 && piece.Position.Column == rows - 1)
                || (piece.Position.Row == rows - 1 && piece.Position.Column == 0)
                || (piece.Position.Row == rows - 1 && piece.Position.Column == rows - 1)
                )
            {
                isCorner = true;
            }

            return isCorner;
        }