Class FixedTargetingStrategy
java.lang.Object
de.gurkenlabs.litiengine.abilities.targeting.TargetingStrategy
de.gurkenlabs.litiengine.abilities.targeting.FixedTargetingStrategy
A targeting strategy that always resolves to a predefined, fixed set of combat entities.
Unlike dynamic strategies, this implementation ignores both the impact area and the executing entity, and simply returns the collection of targets supplied at construction time. It is useful for scripted scenarios, cutscenes, or abilities that should always affect a known set of entities (for example, a specific boss and its minions).
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFixedTargetingStrategy(ICombatEntity... fixedTargets) Creates a newFixedTargetingStrategywith the given fixed targets. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<ICombatEntity> findTargetsInternal(Shape impactArea, ICombatEntity executor) Returns the predefined fixed targets, ignoring both the impact area and the executor.Methods inherited from class TargetingStrategy
custom, enemies, executingEntity, findTargets, fixed, friendly, friendlyDead, isMultiTarget, none, prioritizeByDistance, setCustomTargetPriorityComparator, setMultiTarget, setPrioritizeByDistance, withCondition
-
Constructor Details
-
FixedTargetingStrategy
Creates a new
FixedTargetingStrategywith the given fixed targets.The strategy is automatically configured as multi-target when more than one entity is supplied, and as single-target otherwise. The results are never sorted by distance.
- Parameters:
fixedTargets- the combat entities that will always be returned as the targets of this strategy. May be empty.
-
-
Method Details
-
findTargetsInternal
Returns the predefined fixed targets, ignoring both the impact area and the executor.- Specified by:
findTargetsInternalin classTargetingStrategy- Parameters:
impactArea- the shape representing the ability's area of effect; ignored by this strategy.executor- the combat entity executing the ability; ignored by this strategy.- Returns:
- the fixed collection of targets supplied at construction time.
-