Class SensorLeash

All Implemented Interfaces:
RoleStateChange, Sensor, IAnnotatedComponent, IComponentExecutionControl

public class SensorLeash extends SensorBase
A sensor that triggers when the NPC is outside a specified range from the leash point
  • Constructor Details

  • Method Details

    • matches

      public boolean matches(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, double dt, @Nonnull Store<EntityStore> store)
      Specified by:
      matches in interface Sensor
      Overrides:
      matches in class SensorBase
    • getSensorInfo

      public InfoProvider getSensorInfo()
      Description copied from interface: Sensor
      Get access to sensor info result if the sensor supports this in principle.

      Sensors can provide positional (and other) information if they are in matching state, like SensorPlayer or SensorEntity, while for other sensors, like SensorState, this wouldn't make sense. For sensors wrapping other sensors, like SensorAnd or SensorOr, it depends on the child sensors if positional information can be returned.

      Note: Returning a non-null value does not imply that the sensor actually returns a valid position in the current moment. This will depend on whether the sensor is in matching state or not.

      Returns:
      InfoProvider instance if the sensor is capable of returning information else null