antichess.movegen
Class UnionMoveGenerator<M extends Move>

java.lang.Object
  extended by 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


Constructor Summary
UnionMoveGenerator(MoveGenerator<M> m1, MoveGenerator<M> m2)
           
 
Method Summary
 List<M> getMoves(Piece piece, Board<M> board)
           
 boolean isMoveLegal(M move, Board<M> board)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnionMoveGenerator

public UnionMoveGenerator(MoveGenerator<M> m1,
                          MoveGenerator<M> m2)
Effects:
Construct a MoveGenerator that returns the union of the moves of the two generators
Method Detail

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