Interface TransformComponentExtended

Hierarchy

Properties

componentId: number
componentName: string
componentType: LastWriteWinElementSet

Methods

  • 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 | TransformType

  • This function writes the whole state of the component into a ByteBuffer

    Parameters

    • buffer: ByteBuffer
    • Optional filterEntity: ((entity: Entity) => boolean)
        • (entity: Entity): boolean
        • Parameters

          Returns boolean

    Returns void

  • 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 readonly component of the entity (to mutate it, use getMutable instead), throws an error if the entity doesn't have the component.

    Returns

    Parameters

    • entity: Entity

      Entity that will be used to get the component

    Returns DeepReadonlyObject<TransformType>

  • This function returns an iterable with all the CRDT updates that need to be broadcasted to other actors in the system. After returning, this function clears the internal dirty state. Updates are produced only once.

    Returns Iterable<CrdtMessageBody>

  • 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 TransformType

  • 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 | TransformType

  • Get the mutable component of the entity. If the entity doesn't have the component, it's created.

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

    Parameters

    Returns TransformType

  • Get the readonly component of the entity (to mutate it, use getMutable instead), or null if the entity doesn't have the component.

    Parameters

    • entity: Entity

      Entity that will be used to try to get the component

    Returns null | DeepReadonlyObject<TransformType>

  • Get if the entity has this component

    Parameters

    • entity: Entity

      entity to test

    Returns boolean

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

    Parameters

    Returns void

  • This function receives a CRDT update and returns a touple with a "conflict resoluton" message, in case of the sender being updated or null in case of noop/accepted change. The second element of the touple is the modified/changed/deleted value.

    Parameters

    Returns [null | ConflictResolutionMessage, undefined | TransformType]