Class SensorOnGround

All Implemented Interfaces:
RoleStateChange, Sensor, IAnnotatedComponent, IComponentExecutionControl

public class SensorOnGround extends SensorBase
An NPC sensor to detect whether the NPC is currently on the ground
  • Constructor Details

    • SensorOnGround

      public SensorOnGround(@Nonnull BuilderSensorBase builderSensorBase)
      Default Constructor for a SensorOnGround instance
      Parameters:
      builderSensorBase - The builder used to build this sensor
  • 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