Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TagComponent<TypeName, MaybeValueType>

Tag components are a way of tagging a component with label and a simple value

Type parameters

  • TypeName: string

  • MaybeValueType: string | symbol | number | boolean

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new TagComponent(type: TypeName, value?: MaybeValueType): TagComponent

Properties

Optional Readonly dependencies

dependencies: ComponentCtor[]

Optionally list any component types this component depends on If the owner entity does not have these components, new components will be added to the entity

Only components with zero-arg constructors are supported as automatic component dependencies

Optional onAdd

onAdd: function

Optional callback called when a component is added to an entity

Type declaration

    • Parameters

      Returns void

Optional onRemove

onRemove: function

Opitonal callback called when acomponent is added to an entity

Type declaration

    • (previousOwner: Entity): void
    • Parameters

      Returns void

Optional owner

owner: Entity

Current owning Entity, if any, of this component. Null if not added to any Entity

Readonly type

type: TypeName

Optional Readonly value

value: MaybeValueType

Methods

clone

  • clone(): this