DefaultSensorEngine

Warning

This documentation is for an implementation of a service. This class is not meant to be used directly; instead use the ISensorEngine service via dependency injection to access this functionality.

Information documented here may not be up to date.

class DefaultSensorEngine : System.Object, ISensorEngine

The default implementation of an T:Protogame.ISensorEngine.

public void Render(IGameContext gameContext, IRenderContext renderContext)

Internally called by T:Protogame.SensorEngineHook to update sensors during the render step.

Parameters:
  • gameContext (Protogame.IGameContext) – The current game context.
  • renderContext (Protogame.IRenderContext) – The current render context.
public void Update(IGameContext gameContext, IUpdateContext updateContext)

Internally called by T:Protogame.SensorEngineHook to update sensors during the update step.

Parameters:
  • gameContext (Protogame.IGameContext) – The current game context.
  • updateContext (Protogame.IUpdateContext) – The current update context.
public void Register(ISensor sensor)

Registers a hardware sensor with the sensor engine, ensuring that it is updated as the game runs.

Parameters:
  • sensor (Protogame.ISensor) – The hardware sensor to register.
public void Deregister(ISensor sensor)

Deregisters a hardware sensor from the sensor engine, ensuring that it is no longer updated as the game runs.

Parameters:
  • sensor (Protogame.ISensor) – The hardware sensor to deregister.