|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CostDecider
Determines the cost of a single move. Used by findPath
and search
.
Field Summary | |
---|---|
static int |
ILLEGAL_MOVE
|
Method Summary | |
---|---|
int |
getCost(Unit unit,
Tile oldTile,
Tile newTile,
int movesLeftBefore,
int turns)
Determines the cost of a single move. |
int |
getMovesLeft()
Gets the number of moves left. |
boolean |
isNewTurn()
Checks if a new turn is needed in order to make the move. |
Field Detail |
---|
static final int ILLEGAL_MOVE
Method Detail |
---|
int getCost(Unit unit, Tile oldTile, Tile newTile, int movesLeftBefore, int turns)
unit
- The Unit
that will be used when
determining the cost. This should be the same type
of unit as the one following the path.oldTile
- The Tile
we are moving from.newTile
- The Tile
we are moving to.movesLeftBefore
- The remaining moves left. The
CostDecider
can use this information
if needed.turns
- The number of turns spent so far.
oldTile
to the newTile
.int getMovesLeft()
getCost(net.sf.freecol.common.model.Unit, net.sf.freecol.common.model.Tile, net.sf.freecol.common.model.Tile, int, int)
.
boolean isNewTurn()
getCost(net.sf.freecol.common.model.Unit, net.sf.freecol.common.model.Tile, net.sf.freecol.common.model.Tile, int, int)
.
true
if the move requires a
new turn and false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |