LightSensor

io.github.srs.model.entity.dynamicentity.sensor.LightSensor
final case class LightSensor[Entity <: DynamicEntity, Env <: Environment](offset: Orientation) extends Sensor[Entity, Env]

A light sensor that senses the light intensity in the environment.

Type parameters

Entity

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

Env

the type of environment in which the sensor operates.

Value parameters

offset

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

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Sensor[Entity, Env]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type Data = Double

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

Concrete methods

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

Senses the light intensity at the position of the sensor in the environment. It uses a cached light map to compute the field of light and samples it at the sensor's position.

Senses the light intensity at the position of the sensor in the environment. It uses a cached light map to compute the field of light and samples it at the sensor's position.

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 light intensity sensed by the sensor.

Definition Classes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product