Class ExecutingEntityTargetTargetingStrategy
java.lang.Object
de.gurkenlabs.litiengine.abilities.targeting.TargetingStrategy
de.gurkenlabs.litiengine.abilities.targeting.ExecutingEntityTargetTargetingStrategy
A targeting strategy that resolves to the current target of the executing entity.
This strategy ignores the impact area and instead delegates to the executor's own target reference. It is useful for abilities that should be applied to whatever entity the caster is currently focused on (for example, a tab-targeted spell).
Note: if the executor has no current target, the returned collection will contain a single
null element. Callers should be prepared to handle this case.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newExecutingEntityTargetTargetingStrategy. -
Method Summary
Modifier and TypeMethodDescriptionfindTargetsInternal(Shape impactArea, ICombatEntity executor) Returns the executor's current target as the sole target, regardless of the given impact area.Methods inherited from class TargetingStrategy
custom, enemies, executingEntity, findTargets, fixed, friendly, friendlyDead, isMultiTarget, none, prioritizeByDistance, setCustomTargetPriorityComparator, setMultiTarget, setPrioritizeByDistance, withCondition
-
Constructor Details
-
ExecutingEntityTargetTargetingStrategy
public ExecutingEntityTargetTargetingStrategy()Creates a new
ExecutingEntityTargetTargetingStrategy.The strategy is configured as single-target and unsorted, since the resulting collection always contains at most one entity (the executor's current target).
-
-
Method Details
-
findTargetsInternal
Returns the executor's current target as the sole target, regardless of the given impact area.- 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; its current target is returned.- Returns:
- an immutable collection containing exactly the executor's current target. The element
may be
nullif the executor has no target set.
-