Package net.sf.freecol.server.ai
Class REFAIPlayer.REFNavyGoalDecider
- java.lang.Object
-
- net.sf.freecol.server.ai.REFAIPlayer.REFNavyGoalDecider
-
- All Implemented Interfaces:
GoalDecider
- Enclosing class:
- REFAIPlayer
private static class REFAIPlayer.REFNavyGoalDecider extends java.lang.Object implements GoalDecider
Goal decider class for the REF Navy
-
-
Constructor Summary
Constructors Constructor Description REFNavyGoalDecider(Player rebel, java.util.Set<Unit> rebelNavy)
Build a new goal decider for the REF to find rebel naval units.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
check(Unit unit, PathNode pathNode)
Checks whether the givenPathNode
is a goal/sub-goal.PathNode
getGoal()
Gets thePathNode
containing the goal.boolean
hasSubGoals()
Determines whether thisGoalDecider
has any sub goals.
-
-
-
Method Detail
-
getGoal
public PathNode getGoal()
Gets thePathNode
containing the goal.- Specified by:
getGoal
in interfaceGoalDecider
- Returns:
- The
PathNode
where theTile
returned bypathNode.getTile()
is the goal.
-
hasSubGoals
public boolean hasSubGoals()
Determines whether thisGoalDecider
has any sub goals.- Specified by:
hasSubGoals
in interfaceGoalDecider
- Returns:
true
if there are any sub goals andfalse
otherwise.
-
check
public boolean check(Unit unit, PathNode pathNode)
Checks whether the givenPathNode
is a goal/sub-goal.- Specified by:
check
in interfaceGoalDecider
- Parameters:
unit
- TheUnit
which we are trying to find a path for.pathNode
- ThePathNode
where theTile
returned bypathNode.getTile()
is the tile to be checked.- Returns:
true
if thePathNode
was either a goal or a sub goal andfalse
otherwise. The goal should be returned byGoalDecider.getGoal()
right after a call to this method, if this method returnstrue
andGoalDecider.hasSubGoals()
returnsfalse
.
-
-