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 floatpriority
-
Constructor Summary
Constructors Constructor Description AbstractTacticalObjective(float priority)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatchangePriority(float newPriority)Change the priority of this objective.floatgetPriority()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:TacticalObjectiveGet the current priority of this objective.- Specified by:
getPriorityin interfaceTacticalObjective- Returns:
- The current priority of this objective.
-
changePriority
public float changePriority(float newPriority)
Description copied from interface:TacticalObjectiveChange the priority of this objective.- Specified by:
changePriorityin interfaceTacticalObjective- Parameters:
newPriority- The new priority.- Returns:
- The old priority.
-
-