Package net.sf.colossus.ai.objectives
Class AbstractTacticalObjective
java.lang.Object
net.sf.colossus.ai.objectives.AbstractTacticalObjective
- All Implemented Interfaces:
TacticalObjective
- Direct Known Subclasses:
CreatureAttackTacticalObjective
,DestroyCreatureTacticalObjective
,PreserveCreatureTacticalObjective
Abstract implementation of @TacticalObjective, handling the priority
stuff to avoid duplication.
- Author:
- Romain Dolbeau
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
changePriority
(float newPriority) Change the priority of this objective.float
Get the current priority of this objective.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.colossus.ai.objectives.TacticalObjective
getDescription, objectiveAttained, situationContributeToTheObjective
-
Field Details
-
priority
private float priority
-
-
Constructor Details
-
AbstractTacticalObjective
public AbstractTacticalObjective(float priority)
-
-
Method Details
-
getPriority
public float getPriority()Description copied from interface:TacticalObjective
Get the current priority of this objective.- Specified by:
getPriority
in interfaceTacticalObjective
- Returns:
- The current priority of this objective.
-
changePriority
public float changePriority(float newPriority) Description copied from interface:TacticalObjective
Change the priority of this objective.- Specified by:
changePriority
in interfaceTacticalObjective
- Parameters:
newPriority
- The new priority.- Returns:
- The old priority.
-