Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EnhancementsComponent

The enhancements component adds enhancements to the given entity. An enhancement is a property like health, damage etc. which can scale. When an enhancement is leveled up, the property value increaes. With this we modelize a progress system in the game, besides of the Upgrades which unlock cool stuff but there are not that many to unlock.

Hierarchy

Index

Constructors

constructor

Methods

canLevelUp

  • canLevelUp(id: any): boolean
  • Checks if a given enhancement can get leveled up, that is, its not at the maximum level

    Parameters

    • id: any

    Returns boolean

deserialize

  • deserialize(data: any): any

getDebugString

  • getDebugString(): string

getEnhancement

  • getEnhancement(id: any): any
  • Returns the given enhancement handle

    Parameters

    • id: any

    Returns any

getEnhancementAmount

  • getEnhancementAmount(id: any): any
  • Returns the amount of improvement the given enhancement has on the current level

    Parameters

    • id: any

    Returns any

getEnhancementAndLevel

  • getEnhancementAndLevel(id: any): object
  • Returns the enhancement handle and its level

    Parameters

    • id: any

    Returns object

    • enhancement: any
    • level: any

getEnhancementLevel

  • getEnhancementLevel(id: any): any
  • Returns the level of a given enhancement

    Parameters

    • id: any

    Returns any

getEnhancementNextAmount

  • getEnhancementNextAmount(id: any): any
  • Retursn the amount of improvement the given enhancement has on the next level

    Parameters

    • id: any

    Returns any

getEnhancementNextCost

  • getEnhancementNextCost(id: any): any
  • Returns the cost of the next upgrade of the enhancement

    Parameters

    • id: any

    Returns any

hasEnhancement

  • hasEnhancement(id: any): boolean
  • Returns if the given enhancement exists on this component

    Parameters

    • id: any

    Returns boolean

internalLevelUpEnhancement

  • internalLevelUpEnhancement(id: any): void
  • Levels up an enancement internally. Performs NO checks!

    Parameters

    • id: any

    Returns void

serialize

  • serialize(): object

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string
  • Returns string

Static getSchema

  • getSchema(): object

Static verify

  • verify(data: any): string