Class engine.generator.interface.ActorFOV

Handles actors field of view When an actor moves it computes a field of view and stores it in self.fov
When an other actor moves it can update the fov of seen actors

Methods



Methods

engine.generator.interface.ActorFOV:init (t)
Initialises stats with default values if needed

Parameters:

  • t
engine.generator.interface.ActorFOV:computeFOV (radius, block, apply, force, no_store, cache)
Computes actor's FOV

Parameters:

  • radius the FOV radius, defaults to 20
  • block the property to look for FOV blocking, defaults to "block_sight"
  • apply an apply function that will be called on each seen grids, defaults to nil
  • force set to true to force a regeneration even if we did not move
  • no_store do not store FOV informations (such as actors in FOV)
  • cache if true it will use the cache given by the map, for the map actor. It can be used for other actors is they have the same block settings
engine.generator.interface.ActorFOV:computeFOVBeam (radius, dir, angle, block, apply, force, no_store, cache)
Computes actor's FOV as a beam

Parameters:

  • radius the FOV radius, defaults to 20
  • dir the FOV beam direction (1,2,3,4,6,7,8,9)
  • angle the FOV beam spread
  • block the property to look for FOV blocking, defaults to "block_sight"
  • apply an apply function that will be called on each seen grids, defaults to nil
  • force set to true to force a regeneration even if we did not move
  • no_store do not store FOV informations
  • cache if true it will use the cache given by the map, for the map actor. It can be used for other actors is they have the same block settings
engine.generator.interface.ActorFOV:updateFOV (a, sqdist)
Update our fov to include the given actor at the given dist

Parameters:

  • a the actor to include
  • sqdist the squared distance to that actor
generated by LDoc 1.4.3