Constructor
new WickObjectCache()
- Description:
Create a WickObjectCache.
- Source:
Methods
addObject(object)
- Description:
Add an object to the cache.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
object |
Wick.Base | the object to add |
clear()
- Description:
Remove all objects from the Object Cache.
- Source:
clearObjectToBeAutosaved(object)
- Description:
Removes a given object from the list of objects that must be autosaved.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
object |
Wick.Base | the object to remove from the list of objects to be autosaved. |
getActiveObjects(project) → {Array.<Wick.Base>}
- Description:
Get all objects that are referenced in the given project.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
project |
Wick.Project | the project to check if children are active in. |
Returns:
the active objects.
- Type
- Array.<Wick.Base>
getAllObjects() → {Array.<Wick.Base>}
- Description:
All objects in the cache.
- Source:
Returns:
- Type
- Array.<Wick.Base>
getObjectByUUID() → {Wick.Base}
- Description:
Get an object by its UUID.
- Source:
Returns:
- Type
- Wick.Base
getObjectsNeedAutosaved() → {Array.<Wick.Base>}
- Description:
Returns an array of objects that currently need to be autosaved.
- Source:
Returns:
The objects that are marked to be autosaved.
- Type
- Array.<Wick.Base>
markObjectToBeAutosaved(object)
- Description:
Saves an object to be autosaved upon the next auto save.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
object |
Wick.Base | object to be saved. |
objectNeedsAutosave(object)
- Description:
Returns true if a given object is marked to be autosaved during the next autosave.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
object |
Wick.Base | the object to check for autosave |
removeObject(object)
- Description:
Remove an object from the cache.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
object |
Wick.Base | the object to remove from the cache |
removeObjectByUUID(uuid)
- Description:
Remove an object from the cache.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
uuid |
string | uuid of the object to remove from the cache |
removeTemporaryObjects()
- Description:
Removes all objects with the temporary flag set to true.
- Source:
removeUnusedObjects(project)
- Description:
Remove all objects that are in the project, but are no longer linked to the root object. This is basically a garbage collection function. This function attempts to keep objects that are referenced in undo/redo.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
project |
Wick.Project | the project to use to determine which objects have no references |