示例#1
0
        public void GenerateLazyMoves(int depth, Moves moves, Moves.enmMovesType movesType, Square squareAttacking)
        {
//			if (squareAttacking==null)
//			{
            // All moves as defined by movesType
            foreach (Piece piece in this.m_colPieces)
            {
                piece.GenerateLazyMoves(moves, movesType);

                if (movesType != Moves.enmMovesType.All)
                {
                    Move move;
                    int  intIndex;
                    for (intIndex = moves.Count - 1; intIndex >= 0; intIndex--)
                    {
                        move = moves.Item(intIndex);
                        if (!(
                                move.Name == Move.enmName.PawnPromotion
                                ||
                                move.To.Ordinal == squareAttacking.Ordinal
//								||
//								(depth>=-2 && move.From.Piece.BasicValue<move.To.Piece.BasicValue)
                                ||
                                (depth >= -4 && !move.To.CanBeMovedToBy(move.Piece.Player.OtherPlayer))                               // &&
                                )
                            )
                        {
                            moves.Remove(move);
                        }
                    }
                }
            }
//			}
//			else
//			{
//				// Just re-capture moves
//				squareAttacking.AttackerMoveList(moves, this);
//			}

/*
 *
 */
        }