Class FixedTargetingStrategy

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

public class FixedTargetingStrategy extends TargetingStrategy

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 Details

    • FixedTargetingStrategy

      protected FixedTargetingStrategy(ICombatEntity... fixedTargets)

      Creates a new FixedTargetingStrategy with 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

      protected Collection<ICombatEntity> findTargetsInternal(Shape impactArea, ICombatEntity executor)
      Returns the predefined fixed targets, ignoring both the impact area and the executor.
      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; ignored by this strategy.
      Returns:
      the fixed collection of targets supplied at construction time.