Interface SimulationEntity.LineOfSight<I>

Type Parameters:
I - plugin-defined input for each run
Enclosing class:
SimulationEntity
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface SimulationEntity.LineOfSight<I>
Input-aware line-of-sight rule used by simulated entity attacks.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a rule that treats every target as visible.
    boolean
    test(I input, Rect source, Rect target)
    Returns whether source can see target.
    Returns a rule that uses loaded-world line of sight.
  • Method Details

    • clear

      static <I> SimulationEntity.LineOfSight<I> clear()
      Returns a rule that treats every target as visible.
      Type Parameters:
      I - plugin-defined input for each run
    • world

      static <I> SimulationEntity.LineOfSight<I> world()
      Returns a rule that uses loaded-world line of sight.

      This is useful when the simulation uses world coordinates. Local-grid simulations should usually provide their own collision-aware rule instead.

      Type Parameters:
      I - plugin-defined input for each run
    • test

      boolean test(I input, Rect source, Rect target)
      Returns whether source can see target.
      Parameters:
      input - plugin-defined state for this run
      source - simulated source area
      target - simulated target area