net.sf.freecol.common.model.pathfinding
Class CostDeciders

java.lang.Object
  extended by net.sf.freecol.common.model.pathfinding.CostDeciders

public final class CostDeciders
extends java.lang.Object

Cost deciders to be used while finding paths.


Constructor Summary
CostDeciders()
           
 
Method Summary
static CostDecider avoidSettlements()
          A CostDecider returning only the cost of moving across the terrain (no additional cost for blocking enemy units etc).
static CostDecider avoidSettlementsAndBlockingUnits()
          A CostDecider for avoiding using tiles which have blocking enemy units on them.
static CostDecider defaultFor(Unit unit)
          Selects a default CostDecider for the given units.
static CostDecider numberOfTiles()
          A CostDecider only considering the number of tiles visited when determining the cost.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CostDeciders

public CostDeciders()
Method Detail

defaultFor

public static CostDecider defaultFor(Unit unit)
Selects a default CostDecider for the given units.

Parameters:
unit - The unit to create a CostDecider for.
Returns:
A CostDecider depending on the owner of the unit (ai/human) and if the unit can attack other units.

avoidSettlements

public static CostDecider avoidSettlements()
A CostDecider returning only the cost of moving across the terrain (no additional cost for blocking enemy units etc). Paths containing an enemy settlement are considered illegal.

Returns:
The CostDecider.

avoidSettlementsAndBlockingUnits

public static CostDecider avoidSettlementsAndBlockingUnits()
A CostDecider for avoiding using tiles which have blocking enemy units on them. Paths containing an enemy settlement are considered illegal, and so are paths where the next move has an enemy unit on it.

Returns:
The CostDecider.

numberOfTiles

public static CostDecider numberOfTiles()
A CostDecider only considering the number of tiles visited when determining the cost.

Returns:
The CostDecider.