Two.Registry

An arbitrary class to manage a directory of things. Mainly used for keeping tabs of textures in Two.js.

add

ArgumentDescription
idA unique identifier.
objAny type of variable to be registered to the directory.

Adds any value to the directory. Assigned by the id.

remove

ArgumentDescription
idA unique identifier.

Remove any value from the directory by its id.

get

Returns: Object

The associated value. If unavailable then undefined is returned.

ArgumentDescription
idA unique identifier.

Get a registered value by its id.

contains

Returns: Boolean

ArgumentDescription
idA unique identifier.

Convenience method to see if a value is registered to an id already.