Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BuffSystem

Accumulates the buffs provided by all buidings and powerups and transforms them into a grid, so that for every tile we can query which buffs for which faction are active there.

Hierarchy

Index

Constructors

constructor

Methods

draw

  • draw(parameters: any): void
  • Parameters

    • parameters: any

    Returns void

getFactionBuffs

  • getFactionBuffs(x: any, y: any, faction: any): number
  • Returns all faction buffs at the given tile. These are the buffs from the current faction plus any buffs from merged factions (i.e. the neutral faction)

    Parameters

    • x: any
    • y: any
    • faction: any

    Returns number

getGlobalFactionBuffsOnly

  • getGlobalFactionBuffsOnly(faction: any): any
  • Returns all global buffs for the given faction

    Parameters

    • faction: any

    Returns any

getHostileBuffs

  • getHostileBuffs(x: any, y: any, faction: any): number
  • Returns all hostile buffs at the given tile. Hostile buffs are the combined buffs from all factions which are hostile to the given faciton

    Parameters

    • x: any
    • y: any
    • faction: any

    Returns number

onBuildingUpgraded

  • onBuildingUpgraded(building: any): void
  • Parameters

    • building: any

    Returns void

onStructureDestroyed

  • onStructureDestroyed(building: any): void
  • Parameters

    • building: any

    Returns void

onStructurePlaced

  • onStructurePlaced(building: any): void
  • Parameters

    • building: any

    Returns void

recompute

  • recompute(): void
  • Recomputes the buffs

    Returns void

startDraw

  • startDraw(parameters: any): void
  • see

    GameSystem.draw Wrapper arround the draw method

    Parameters

    • parameters: any

    Returns void

update

  • update(): void
  • Recomputes the buffs if required

    Returns void