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

java.lang.Object
  extended by net.sf.freecol.common.model.pathfinding.BaseCostDecider
      extended by net.sf.freecol.common.model.pathfinding.AvoidBlockingUnitsCostDecider
All Implemented Interfaces:
CostDecider

 class AvoidBlockingUnitsCostDecider
extends BaseCostDecider

A CostDecider avoid units blocking the path.


Field Summary
 
Fields inherited from class net.sf.freecol.common.model.pathfinding.BaseCostDecider
moveType
 
Fields inherited from interface net.sf.freecol.common.model.pathfinding.CostDecider
ILLEGAL_MOVE
 
Constructor Summary
AvoidBlockingUnitsCostDecider()
           
 
Method Summary
 int getCost(Unit unit, Tile oldTile, Tile newTile, int movesLeftBefore, int turns)
          Determines the cost of a single move.
 
Methods inherited from class net.sf.freecol.common.model.pathfinding.BaseCostDecider
getMovesLeft, isNewTurn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvoidBlockingUnitsCostDecider

AvoidBlockingUnitsCostDecider()
Method Detail

getCost

public int getCost(Unit unit,
                   Tile oldTile,
                   Tile newTile,
                   int movesLeftBefore,
                   int turns)
Determines the cost of a single move.

Specified by:
getCost in interface CostDecider
Overrides:
getCost in class BaseCostDecider
Parameters:
unit - The Unit making the move.
oldTile - The Tile we are moving from.
newTile - The Tile we are moving to.
movesLeftBefore - The remaining moves left.
turns - The number of turns spent so far.
Returns:
The cost of moving the given unit from the oldTile to the newTile.