civquest.units
Class PossibleMovePath

java.lang.Object
  extended bycivquest.units.MovePath
      extended bycivquest.units.PossibleMovePath

public class PossibleMovePath
extends MovePath

A possible MovePath between two fields. It consists of a number of PathSteps. Each PathStep saves information about one Field the MovePath touchs - this includes the source-field!!! The units stored in the Collection (in MovePath) MUST ALWAYS be located on the field of the first PathStep, as long as this PossibleMovePath is in use.


Nested Class Summary
 class PossibleMovePath.PathStep
          One step of a PossibleMovePath.
 
Field Summary
 
Fields inherited from class civquest.units.MovePath
turn, units
 
Constructor Summary
PossibleMovePath(java.util.Collection units, int turn)
           
 
Method Summary
 void addStepToBeginning(Field to, int speed, int turn, int time, boolean sure)
          Add a step with the given properties to the beginning of the step-list.
 void addStepToEnd(Field to, int speed, int turn, int time, boolean sure)
          Add a step with the given properties to the end of the step-list.
 java.util.List getAllSteps()
          Returns a List with all steps of this move-path.
 int getSize()
           
 java.util.Iterator getStepIterator()
          Returns an Iterator iterating over all steps of this PossibleMovePath.
 int getTimeOffset()
           
 boolean isMovePathPossible()
           
 void removeFirstStep()
           
 void setTimeOffset(int timeOffset)
           
 java.lang.String toString()
          Retrieve a String representation of this object
 
Methods inherited from class civquest.units.MovePath
getTurn, getUnitLocation, getUnits, getUnitsIterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PossibleMovePath

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

isMovePathPossible

public boolean isMovePathPossible()
Specified by:
isMovePathPossible in class MovePath

setTimeOffset

public void setTimeOffset(int timeOffset)

getTimeOffset

public int getTimeOffset()

getStepIterator

public java.util.Iterator getStepIterator()
Returns an Iterator iterating over all steps of this PossibleMovePath.

Returns:
an iterator iterating over all steps of this PossibleMovePath

getAllSteps

public java.util.List getAllSteps()
Returns a List with all steps of this move-path. Do not modify it! And use an iterator for traversing it, do not access the elements by index.


getSize

public int getSize()

addStepToBeginning

public void addStepToBeginning(Field to,
                               int speed,
                               int turn,
                               int time,
                               boolean sure)
Add a step with the given properties to the beginning of the step-list. It will be the very first step afterwards. For documentation of the arguments see the documenation of inner-class PathStep.


addStepToEnd

public void addStepToEnd(Field to,
                         int speed,
                         int turn,
                         int time,
                         boolean sure)
Add a step with the given properties to the end of the step-list. It will be the last step afterwards. For documentation of the arguments see the documenation of inner-class PathStep.


removeFirstStep

public void removeFirstStep()

toString

public java.lang.String toString()
Retrieve a String representation of this object

Returns:
a String representation of this object.
See Also:
Object.toString()