Class: Component

Component(reporter, settings)

Base class for loadable components

Constructor

new Component(reporter, settings)

Parameters:
Name Type Description
reporter Reporter
settings Object
Properties
Name Type Attributes Description
id UUID <optional>
name string <optional>
debug Boolean <optional>
Source:

Members

(protected) _content :ComponentContent

The "usable" part of this component. The product. The fruit.
Type:
Source:
To Do:
  • object props should not be hardcoded

_debug :Boolean

Debug flag
Type:
  • Boolean
Source:

(protected) _error :ComponentContent

Error register.
Type:
Source:
To Do:
  • object props should not be hardcoded

_exportLevel :ExportLevel

Type:
Source:

_exportName :Object

Type:
  • Object
Properties:
Name Type Description
singular string
plural string
Source:

(protected) _settings :Object

Type:
  • Object
Source:

(protected) _status

Inner status tracking
Source:
To Do:
  • object props should not be hardcoded

(protected) _tree

Source:

_tree :ComponentTree

Type:
Source:

loadStatusSortMap :Object.<ComponentPartQualityStatus, number>

Relative value of states
Type:
Source:

mainPlaceholder :Object3D

3D Object to use as placeholder in the scene
Type:
  • Object3D
Source:

materializable :Boolean

Type:
  • Boolean
Source:

parts :Array.<ComponentPart>

Type:
Source:

qualities :Array.<LoadingQuality>

Type:
Source:

qualitySortMap :Object.<LoadingQuality, number>

Relative value of loading qualities
Type:
Source:

settings :Object

Type:
  • Object
Source:

status :ComponentStatus

Component status
Type:
Source:
To Do:
  • object props should not be hardcoded

tree :ComponentTree

Type:
Source:

Methods

(static) partQualityStatusAtom(name, reporter) → {Atom}

Builds a component part quality atom
Parameters:
Name Type Description
name string
reporter Reporter
Source:
Returns:
Type
Atom

(static) sortQualityArray(arr) → {Array.<LoadingQuality>}

Sorts quality arrays high to low
Parameters:
Name Type Description
arr Array.<LoadingQuality>
Source:
Returns:
Type
Array.<LoadingQuality>

(static) sortStatusArray(arr) → {Array.<ComponentPartQualityStatus>}

Sorts loading status arrays high to low
Parameters:
Name Type Description
arr Array.<ComponentPartQualityStatus>
Source:
Returns:
Type
Array.<ComponentPartQualityStatus>

(protected) _onTreeSet()

Source:

(protected) _onTreeUnset()

Source:

(protected) _setContent(part, quality, content) → {Promise.<Array.<any>>}

Set content and update status to "ready"
Parameters:
Name Type Description
part ComponentPart
quality LoadingQuality
content any
Source:
Returns:
Type
Promise.<Array.<any>>

(protected) _setError(part, quality, error) → {Promise.<Array.<any>>}

Set error and update status to "error"
Parameters:
Name Type Description
part ComponentPart
quality LoadingQuality
error Error
Source:
Returns:
Type
Promise.<Array.<any>>

toJSON() → {Object}

Export to JSON
Source:
Returns:
Type
Object