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
public abstract class AbstractTacticalObjective extends java.lang.Object implements TacticalObjective
Abstract implementation of @TacticalObjective, handling the priority stuff to avoid duplication.- Author:
- Romain Dolbeau
-
-
Field Summary
Fields Modifier and Type Field Description private float
priority
-
Constructor Summary
Constructors Constructor Description AbstractTacticalObjective(float priority)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
changePriority(float newPriority)
Change the priority of this objective.float
getPriority()
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
-
-
-
-
Method Detail
-
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.
-
-