civquest.units
Class GEMUnitMover

java.lang.Object
  extended bycivquest.units.UnitMover
      extended bycivquest.units.GEMUnitMover

public class GEMUnitMover
extends UnitMover

GEMUnitMover.java


Constructor Summary
GEMUnitMover()
           
GEMUnitMover(MoveCalculator moveCalculator)
           
 
Method Summary
 GameChange[] getUnitMoveChanges(java.util.Collection units, Field to)
          Returns all GameChanges necessary for moving the given unit-group to the given field.
 void setMoveCalculator(MoveCalculator moveCalculator)
           
 
Methods inherited from class civquest.units.UnitMover
getChangesForMoveAlongPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GEMUnitMover

public GEMUnitMover()

GEMUnitMover

public GEMUnitMover(MoveCalculator moveCalculator)
Method Detail

setMoveCalculator

public void setMoveCalculator(MoveCalculator moveCalculator)

getUnitMoveChanges

public GameChange[] getUnitMoveChanges(java.util.Collection units,
                                       Field to)
Description copied from class: UnitMover
Returns all GameChanges necessary for moving the given unit-group to the given field. The move given by the GameChanges is only valid (in the sense of the rules) if they get executed immediately after they where returned.

Specified by:
getUnitMoveChanges in class UnitMover
Parameters:
units - a Collection of units, all located on the same Field, expected to be non-empty
to - a neighbor-field of the units current field
Returns:
GameChanges necessary for performing the move - they must be executed in the order they are stored in the array. The array is empty, if the move can't be performed within this turn. null gets returned if the move isn't possible at all (the MoveCalculator returns an ImpossibleMovePath)