示例#1
0
文件: Pawn.cs 项目: prezz/Firoz-Chess
        /// <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;
              }
        }
示例#2
0
文件: Pawn.cs 项目: prezz/Firoz-Chess
        /// <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;
            }
        }
示例#3
0
 /// <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);
 }
示例#4
0
 /// <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);
 }