Interface TagsComponentDefinitionExtended

Hierarchy

Properties

componentId: number
componentName: string
componentType: LastWriteWinElementSet
schema: ISchema<TagsType>

Methods

  • Add a tag to the entity's Tags component or create the component if it doesn't exist and add the tag

    Returns

    true

    Parameters

    • entity: Entity

      entity to add the tag to

    • tagName: string

      the tag name to add

    Returns boolean

  • Add the current component to an entity, throw an error if the component already exists (use createOrReplace instead).

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity that will be used to create the component

    • Optional val: TagsType

      The initial value

    Returns TagsType

  • Add the current component to an entity or replace the content if the entity already has the component

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity that will be used to create or replace the component

    • Optional val: TagsType

      The initial or new value

    Returns TagsType

  • Delete the current component to an entity, return null if the entity doesn't have the current component.

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity to delete the component from

    Returns null | TagsType

  • Marks the entity as deleted and signals it cannot be used ever again. It must clear the component internal state, produces a synchronization message to remove the component from the entity.

    Parameters

    • entity: Entity

      Entity ID that was deleted.

    • markAsDirty: boolean

    Returns void

  • Get the mutable component of the entity, throw an error if the entity doesn't have the component.

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity to get the component from

    Returns TagsType

  • Get the mutable component of the entity, return null if the entity doesn't have the component.

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity to get the component from

    Returns null | TagsType

  • Triggers the callback if the entity has changed on the last tick. If the value is undefined, the component was deleted.

    Parameters

    Returns void

  • Remove a tag from the entity's Tags component

    Returns

    true if successful, false if the entity doesn't have a Tags component or the tag doesn't exist

    Parameters

    • entity: Entity

      entity to remove the tag from

    • tagName: string

      the tag name to remove

    Returns boolean