EmbeddedEntity

EmbeddedEntity

An abstract class implementation for an EmbeddedEntity object within a parent Entity

Members

data :Data

Source:

The embedded entity data object

Type:

id :string

Source:

A reference to the _id attribute of the EmbeddedEntity data

Type:
  • string

parent :Entity

Source:

The parent Entity to which this belongs

Type:

Methods

getFlag(scope, key) → {*}

Source:

Get the value of a "flag" for this PlaceableObject See the setFlag method for more details on flags

Parameters:
Name Type Description
scope string

The flag scope which namespaces the key

key string

The flag key

Returns:

The flag value

Type
*

prepareData()

Source:

Data preparation steps taken by the EmbeddedEntity instance when it's underlying data changes

(async) setFlag(scope, key, value) → {Promise}

Source:

Assign a "flag" to this Entity. Flags represent key-value type data which can be used to store flexible or arbitrary data required by either the core software, game systems, or user-created modules.

Each flag should be set using a scope which provides a namespace for the flag to help prevent collisions.

Flags set by the core software use the "core" scope. Flags set by game systems or modules should use the canonical name attribute for the module Flags set by an individual world should "world" as the scope.

Flag values can assume almost any data type. Setting a flag value to null will delete that flag.

Parameters:
Name Type Description
scope string

The flag scope which namespaces the key

key string

The flag key

value *

The flag value

Returns:

A Promise resolving to the updated PlaceableObject

Type
Promise

(async) unsetFlag(scope, key) → {Promise}

Source:

Remove a flag assigned to the Entity

Parameters:
Name Type Description
scope string

The flag scope which namespaces the key

key string

The flag key

Returns:

A Promise resolving to the updated Entity

Type
Promise