/// <summary> /// Initializes a new instance of the Pawn class. /// </summary> /// <param name="color">Color, white or black, the piece represents.</param> public Pawn(PieceColor color) { m_iterator = new BoardIterator(null, Square.None, Direction.NoDirection); if (color == PieceColor.White) { m_color = PieceColor.White; m_opponentColor = PieceColor.Black; m_directions[0] = Direction.Up; m_directions[1] = Direction.UpLeft; m_directions[2] = Direction.UpRight; moveAgainRow = 2; } if (color == PieceColor.Black) { m_color = PieceColor.Black; m_opponentColor = PieceColor.White; m_directions[0] = Direction.Down; m_directions[1] = Direction.DownLeft; m_directions[2] = Direction.DownRight; moveAgainRow = 5; } }
/// <summary> /// Initializes a new instance of the Pawn class. /// </summary> /// <param name="color">Color, white or black, the piece represents.</param> public Pawn(PieceColor color) { m_iterator = new BoardIterator(null, Square.None, Direction.NoDirection); if (color == PieceColor.White) { m_color = PieceColor.White; m_opponentColor = PieceColor.Black; m_directions[0] = Direction.Up; m_directions[1] = Direction.UpLeft; m_directions[2] = Direction.UpRight; moveAgainRow = 2; } if (color == PieceColor.Black) { m_color = PieceColor.Black; m_opponentColor = PieceColor.White; m_directions[0] = Direction.Down; m_directions[1] = Direction.DownLeft; m_directions[2] = Direction.DownRight; moveAgainRow = 5; } }
/// <summary> /// Initializes a new instance of the Bishop class. /// </summary> /// <param name="color">Color, white or black, the piece represents.</param> public Bishop(PieceColor color) { m_color = color; m_iterator = new BoardIterator(null, Square.None, Direction.NoDirection); }
/// <summary> /// Initializes a new instance of the Queen class. /// </summary> /// <param name="color">Color, white or black, the piece represents.</param> public Queen(PieceColor color) { m_color = color; m_iterator = new BoardIterator(null, Square.None, Direction.NoDirection); }