antichess.movegen
Class UnionMoveGenerator<M extends Move>
java.lang.Object
antichess.movegen.UnionMoveGenerator<M>
- All Implemented Interfaces:
- MoveGenerator<M>
public class UnionMoveGenerator<M extends Move>
- extends Object
- implements MoveGenerator<M>
A UnionMoveGenerator is a move generator that unions the moves
produced by two MoveGenerators
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnionMoveGenerator
public UnionMoveGenerator(MoveGenerator<M> m1,
MoveGenerator<M> m2)
- Effects:
- Construct a MoveGenerator that returns the union of
the moves of the two generators
getMoves
public List<M> getMoves(Piece piece,
Board<M> board)
- Specified by:
getMoves
in interface MoveGenerator<M extends Move>
- Returns:
- an interator of moves the given piece can perform on
the board
isMoveLegal
public boolean isMoveLegal(M move,
Board<M> board)
- Specified by:
isMoveLegal
in interface MoveGenerator<M extends Move>
- Returns:
- true iff the given move is allowed by its piece's
movement types