Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Tag

Hierarchy

  • Tag

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Tag(): Tag

Properties

Private Static cache

cache: {} = ...

Type declaration

  • [id: string]: any

Methods

Static for

  • for<Name>(name: Name): Constructor<EntityTag<Name>, any>
  • This can be used to assign an entity a unique component type, for identification purposes.

    Example:

     const registry = new Registry();
     // create
     const enemy = registry.create(Tag.for("Enemy"));
     const player = registry.create(Tag.for("Player"));
    
     // query
     registry.view(Tag.for("Enemy")).each(() => { ... });
     registry.view(Tag.for("Player")).each(() => { ... });
    

    Type parameters

    • Name: TagName

    Parameters

    • name: Name

    Returns Constructor<EntityTag<Name>, any>

Generated using TypeDoc