Sensor

io.github.srs.model.entity.dynamicentity.sensor.Sensor
See theSensor companion object
trait Sensor[-Entity <: DynamicEntity, -Env <: Environment]

Represents a sensor that can sense the environment for a dynamic entity.

Type parameters

Entity

the type of dynamic entity that the sensor can act upon.

Env

the type of environment in which the sensor operates.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class LightSensor[Entity, Env]
class ProximitySensor[Entity, Env]

Members list

Type members

Types

type Data

The type of data that the sensor returns. This type can vary based on the specific sensor implementation.

The type of data that the sensor returns. This type can vary based on the specific sensor implementation.

Attributes

Value members

Abstract methods

The offset orientation of the sensor relative to the entity's orientation.

The offset orientation of the sensor relative to the entity's orientation.

Attributes

Returns

the orientation offset of the sensor.

def sense[F[_] : Monad](entity: Entity, env: Env): F[Data]

Senses the environment for the given entity and returns the data collected by the sensor.

Senses the environment for the given entity and returns the data collected by the sensor.

Type parameters

F

the effect type in which the sensing operation is performed.

Value parameters

entity

the dynamic entity that the sensor is attached to.

env

the environment in which the sensor operates.

Attributes

Returns

a monadic effect containing the data sensed by the sensor.