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 booleancheck(Unit unit, PathNode pathNode)Checks whether the givenPathNodeis a goal/sub-goal.PathNodegetGoal()Gets thePathNodecontaining the goal.booleanhasSubGoals()Determines whether thisGoalDeciderhas any sub goals.
-
-
-
Method Detail
-
getGoal
public PathNode getGoal()
Gets thePathNodecontaining the goal.- Specified by:
getGoalin interfaceGoalDecider- Returns:
- The
PathNodewhere theTilereturned bypathNode.getTile()is the goal.
-
hasSubGoals
public boolean hasSubGoals()
Determines whether thisGoalDeciderhas any sub goals.- Specified by:
hasSubGoalsin interfaceGoalDecider- Returns:
trueif there are any sub goals andfalseotherwise.
-
check
public boolean check(Unit unit, PathNode pathNode)
Checks whether the givenPathNodeis a goal/sub-goal.- Specified by:
checkin interfaceGoalDecider- Parameters:
unit- TheUnitwhich we are trying to find a path for.pathNode- ThePathNodewhere theTilereturned bypathNode.getTile()is the tile to be checked.- Returns:
trueif thePathNodewas either a goal or a sub goal andfalseotherwise. The goal should be returned byGoalDecider.getGoal()right after a call to this method, if this method returnstrueandGoalDecider.hasSubGoals()returnsfalse.
-
-