Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DestroyIndicatorSystem

Spawns destroy indicators when entities die

Hierarchy

Index

Constructors

constructor

Methods

cleanup

  • cleanup(): void
  • Cleans up the system, internally called on game destroy

    Returns void

collectIndicator

  • collectIndicator(indicator: any): void
  • Parameters

    • indicator: any

    Returns void

deserialize

  • deserialize(data: any): any
  • Deserializes the system

    Parameters

    • data: any

    Returns any

draw

  • draw(parameters: any): void
  • Parameters

    • parameters: any

    Returns void

generateCachedSprite

  • generateCachedSprite(): void
  • Generates the trash sprite with the "Click to rebuild" text

    Returns void

getIndicatorsWithinRange

  • getIndicatorsWithinRange(__namedParameters: object): any[]
  • Returns all indicators of the given type within the given range

    Parameters

    • __namedParameters: object
      • indicatorType: any
      • radiusWorld: any
      • worldPosition: any

    Returns any[]

hasGravestonesWithinRangeWorldSpace

  • hasGravestonesWithinRangeWorldSpace(__namedParameters: object): boolean
  • Returns if there are any indicators of the given type within the given range

    Parameters

    • __namedParameters: object
      • indicatorType: any
      • radiusWorld: any
      • worldPosition: any

    Returns boolean

onCanvasClick

  • onCanvasClick(screenPos: any): string
  • Handles a click on the canvas, collects nearby indicators

    Parameters

    • screenPos: any

    Returns string

onEntityDestroyed

  • onEntityDestroyed(entity: any): void
  • Spawns a destroy indicator on enemy death in case it has the right component

    Parameters

    • entity: any

    Returns void

onStructurePlaced

  • onStructurePlaced(building: any): void
  • Removes underlying indicators when a building got placed

    Parameters

    • building: any

    Returns void

removeIndicator

  • removeIndicator(indicator: any): void
  • Parameters

    • indicator: any

    Returns void

serialize

  • serialize(): object
  • Allows to serialize the system, could use BaseSerializedObject but multiple inheritance is not possible right now

    Returns object

startDraw

  • startDraw(parameters: any): void
  • see

    GameSystem.draw Wrapper arround the draw method

    Parameters

    • parameters: any

    Returns void

update

  • update(): void
  • Updates the game system, override to perform logic

    Returns void

updateIndicators

  • updateIndicators(): void
  • Internal method ot update the indicators and remove outdated ones

    Returns void

Static getSchema

  • getSchema(): any
  • Returns any