Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DynamicEntityPosCache

Manages dynamic entities (zombies) by assigning them to a tile and tracking their position. That way we can do a very fast lookup and culling.

Hierarchy

  • DynamicEntityPosCache

Index

Constructors

constructor

Methods

drawDebugOverlay

  • drawDebugOverlay(parameters: any): void
  • Draws the debug overlay

    Parameters

    • parameters: any

    Returns void

drawEntities

  • drawEntities(parameters: any): void
  • Draws all dynamic entities

    Parameters

    • parameters: any

    Returns void

internalInsertIntoCacheRow

  • internalInsertIntoCacheRow(cache: any, entity: any): void
  • Inserts an entity into the given cahce

    Parameters

    • cache: any
    • entity: any

    Returns void

onEntityAdded

  • onEntityAdded(entity: any): void
  • Callback when an entity gets added, to add it to the cache

    Parameters

    • entity: any

    Returns void

onEntityDestroyed

  • onEntityDestroyed(entity: any): void
  • Callback when an entity gets destroyed, to remove it from the cache

    Parameters

    • entity: any

    Returns void

update

  • update(): void
  • Returns void

updateEntity

  • updateEntity(entity: any): boolean
  • Updates an entity, that means removing it from his old cache position and assigning it to a new one

    Parameters

    • entity: any

    Returns boolean