Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConsumerComponent

The consumer component marks the entity as available to consume and store (@see StorageComponent) resources. The routing system does no more than connecting all @see {EmitterComponent} with this components.

Hierarchy

Index

Constructors

constructor

Methods

consumesResource

  • consumesResource(resourceId: any): boolean
  • Checks if this consumer consumes the given resource

    Parameters

    • resourceId: any

    Returns boolean

decreasePriority

  • decreasePriority(): boolean
  • Decreases the priority so this consumer gets less important.

    Returns boolean

    true if the priority changed (false if already at lowest prio)

deserialize

  • deserialize(data: any): any

getDebugString

  • getDebugString(): string

getPriorityMultiplicator

  • getPriorityMultiplicator(): any
  • Returns the priority multiplicator, the multiplicator stores how important a building compared to others is. If building A has a priority of 1000 and building B has one of 2000, buildingB will receive twice as much resources as building A

    Returns any

increasePriority

  • increasePriority(): boolean
  • Increases the priority to the next priority level so this consumer gets more important.

    Returns boolean

    true if the priority changed (false if already at max prio)

serialize

  • serialize(): object

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string
  • Returns string

Static getSchema

  • getSchema(): object

Static verify

  • verify(data: any): string