net.sf.colossus.ai.objectives
Class AbstractTacticalObjective

java.lang.Object
  extended by 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
private  float priority
           
 
Constructor Summary
AbstractTacticalObjective(float priority)
           
 
Method Summary
 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
 

Field Detail

priority

private float priority
Constructor Detail

AbstractTacticalObjective

public AbstractTacticalObjective(float priority)
Method Detail

getPriority

public float getPriority()
Description copied from interface: TacticalObjective
Get the current priority of this objective.

Specified by:
getPriority in interface TacticalObjective
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 interface TacticalObjective
Parameters:
newPriority - The new priority.
Returns:
The old priority.