Class MovePath

  extended bycivquest.units.MovePath
Direct Known Subclasses:
ImpossibleMovePath, PossibleMovePath

public abstract class MovePath
extends java.lang.Object

A MovePath describes possible/impossible moves between to fields. Subclasses exist both for possible and for impossible moves. NOTE that a MovePath just shows the situation AT THE TIME IT WAS CALCULATED. Thus, a MovePath can only offer a dest-field for an actual move - the calculation of the properties of the move (for example necessary time) must be performed WITHOUT USING PROPERTIES STORED WITHIN A MOVEPATH. See the UnitMover-hierarchy for more details. The units-collection may not be empty!

Field Summary
protected  int turn
          The turn this MovePath was calculated for
protected  java.util.Collection units
          Units the MovePath was calculated for.
Constructor Summary
MovePath(java.util.Collection units, int turn)
Method Summary
 int getTurn()
 Field getUnitLocation()
 java.util.Collection getUnits()
 java.util.Iterator getUnitsIterator()
abstract  boolean isMovePathPossible()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected java.util.Collection units
Units the MovePath was calculated for. MAY NOT BE EMPTY. At any time while the MovePath is used, all units have to be located on the same Field. (otherwise, getUnitLocation wouldn't make sense)


protected int turn
The turn this MovePath was calculated for

Constructor Detail


public MovePath(java.util.Collection units,
                int turn)
Method Detail


public int getTurn()


public java.util.Collection getUnits()


public Field getUnitLocation()


public java.util.Iterator getUnitsIterator()


public abstract boolean isMovePathPossible()