Class Entity

Hierarchy

  • Entity

Implements

Constructors

Properties

uuidFn: (() => string) = ...

Type declaration

    • (): string
    • Returns string

Accessors

  • get id(): string
  • UUID to identify the entity across instances The ID is generated and must be manually maintained when syncing with another instance

    Returns string

Methods

  • Add a tag to this entity Tagging can be used to mark the entity instead of using an empty marker-component Tags cannot be queried for! They are only markers and should be implemented and used as lean and light-weight as possible.

    Parameters

    Returns Entity

  • Clone this entity with all of its components and tags. This is done by serializing and de-serializing the entity

    Parameters

    • serde: ISerDe

      SerDe to use for serialization

    • Optional uuid: string

      UUID of new component

    Returns Entity

  • Get a component of a certain type which is associated with this entity

    Type Parameters

    • T extends object

    Parameters

    • component: TTypeProto<T>

    Returns undefined | T

  • Check if a certain component is associated with this entity

    Parameters

    • component: ObjectConstructor | TObjectProto

    Returns boolean

Generated using TypeDoc