コード例 #1
0
        /// <summary>
        /// Initializes a new instance of MoveOrganizer.
        /// </summary>
        public MoveOrganizer()
        {
            m_moves  = new List <Move>(32);
            m_pvMove = new MoveIdentifier(Square.None, Square.None, Piece.None);

            //start adding a null value to make space for the pv move if it is encountered during add
            m_moves.Add(null);
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of MoveOrganizer.
        /// </summary>
        /// <param name="pvMove">Sets the pv move that should be prioratized if encoutered during add.</param>
        public MoveOrganizer(MoveIdentifier pvMove)
        {
            m_moves  = new List <Move>(32);
            m_pvMove = pvMove;

            //start adding a null value to make space for the pv move if it is encountered during add
            m_moves.Add(null);
        }
コード例 #3
0
        /// <summary>
        /// Finds the move matching the MoveLookupKey.
        /// </summary>
        /// <param name="match">MoveIdentifier to find corrosponding move for.</param>
        /// <returns>The matching move. Null if a move matching 'match' dosn't exist.</returns>
        public Move Find(MoveIdentifier match)
        {
            foreach (Move move in m_moves)
            {
                if (move != null && move.From == match.From && move.To == match.To)
                {
                    if (move.MoveType == MoveType.PawnPromotionMove)
                    {
                        if (move.PromoteTo == match.PromotionPiece)
                        {
                            return(move);
                        }
                    }
                    else
                    {
                        return(move);
                    }
                }
            }

            return(null);
        }