Class ExecutingEntityTargetingStrategy

java.lang.Object
de.gurkenlabs.litiengine.abilities.targeting.TargetingStrategy
de.gurkenlabs.litiengine.abilities.targeting.ExecutingEntityTargetingStrategy

public class ExecutingEntityTargetingStrategy extends TargetingStrategy

A targeting strategy that always targets the entity executing the ability.

This strategy ignores the impact area entirely and resolves to a single-element collection containing the executor itself. It is useful for self-cast abilities such as heals, buffs, or other effects that should only affect the caster.

See Also:
  • Constructor Details

    • ExecutingEntityTargetingStrategy

      public ExecutingEntityTargetingStrategy()

      Creates a new ExecutingEntityTargetingStrategy.

      The strategy is configured as single-target and unsorted, since the resulting collection always contains exactly one entity (the executor).

  • Method Details

    • findTargetsInternal

      public Collection<ICombatEntity> findTargetsInternal(Shape impactArea, ICombatEntity executor)
      Returns the executing entity as the sole target, regardless of the given impact area.
      Specified by:
      findTargetsInternal in class TargetingStrategy
      Parameters:
      impactArea - the shape representing the ability's area of effect; ignored by this strategy.
      executor - the combat entity executing the ability; this entity is returned as the only target.
      Returns:
      an immutable collection containing exactly the executor.