|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcivquest.units.MoveCalculator
A MoveCalculator determines rules for moving units. It offers functions for calculating MovePaths and for actually moving units.
Constructor Summary | |
MoveCalculator()
|
Method Summary | |
MovePath[] |
calculateMovePaths(java.util.Collection unitCollections,
Field to)
Calculates MovePaths for all unit-groups in the given Collection. |
abstract MovePath |
calculateOneMovePath(java.util.Collection unitCollection,
Field to)
Calculates a MovePath for a move of the given unit-group from its current position to Field |
static java.util.List |
constructUnitGroups(java.util.List units)
Constructs unit-groups for the given units (see calculateMovePaths(java.util.Collection, civquest.Field) ). |
abstract boolean |
moveUnit(long id,
Coordinate to)
Moves the unit with given id to field |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MoveCalculator()
Method Detail |
public abstract boolean moveUnit(long id, Coordinate to)
id
- unit-id as describedto
- field we move to
public MovePath[] calculateMovePaths(java.util.Collection unitCollections, Field to)
to
- the Field we want to move to
public abstract MovePath calculateOneMovePath(java.util.Collection unitCollection, Field to)
to
- a Field
public static java.util.List constructUnitGroups(java.util.List units)
calculateMovePaths(java.util.Collection, civquest.Field)
). All units
located at the same Field will be in the same group.
units
- a List of units
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |