StaticKnowledgeDataTable
Classes
- StaticKnowledgeDataTable
Base class for managing various kinds of static game data
Functions
- generate_id(database) ⇒
string
StaticKnowledgeDataTable
Base class for managing various kinds of static game data
Kind: global class
- StaticKnowledgeDataTable
- .elements :
Object.<T>
- .__json :
Map.<string, object>
- .__array :
Array.<T>
- .__automatic_ids :
boolean
- .__element_type_name :
string
- .isStaticKnowledgeDataTable :
boolean
- .size() ⇒
number
- .contains(id) ⇒
boolean
- .get(id) ⇒
T
|null
- .getMany(ids, result)
- .traverse(visitor, [thisArg])
- .filter(f, [thisArg]) ⇒
Array.<T>
- .asArray() ⇒
Array.<T>
- .add(item) ⇒
boolean
- .parse(json) ⇒
T
|Object
- .load(data, executor) ⇒
Promise
- .linkOne(element, json, database, assetManager) ⇒
Promise
- .link(database, assetManager, executor) ⇒
Promise
- .validateOne(element, database, errorConsumer) ⇒
boolean
- .validate(database, errorConsumer) ⇒
Task
- .elements :
staticKnowledgeDataTable.elements : Object.<T>
Elements mapped by their string ID
Kind: instance property of StaticKnowledgeDataTable
staticKnowledgeDataTable.__json : Map.<string, object>
Kind: instance property of StaticKnowledgeDataTable
Access: protected
staticKnowledgeDataTable.__array : Array.<T>
Array representation of elements, useful for fast traversal
Kind: instance property of StaticKnowledgeDataTable
Access: protected
staticKnowledgeDataTable.__automatic_ids : boolean
Allow automatic ID generation when ID is not present
Kind: instance property of StaticKnowledgeDataTable
Access: protected
staticKnowledgeDataTable.__element_type_name : string
Kind: instance property of StaticKnowledgeDataTable
Access: protected
staticKnowledgeDataTable.isStaticKnowledgeDataTable : boolean
Kind: instance property of StaticKnowledgeDataTable
Read only: true
staticKnowledgeDataTable.size() ⇒ number
Number of elements in the table
Kind: instance method of StaticKnowledgeDataTable
staticKnowledgeDataTable.contains(id) ⇒ boolean
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
id | string |
staticKnowledgeDataTable.get(id) ⇒ T
| null
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
id | string |
staticKnowledgeDataTable.getMany(ids, result)
Kind: instance method of StaticKnowledgeDataTable
Throws:
- Error if an item can't be found
Param | Type |
---|---|
ids | Array.<String> |
result | Array.<T> |
staticKnowledgeDataTable.traverse(visitor, [thisArg])
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
visitor | function |
[thisArg] | * |
staticKnowledgeDataTable.filter(f, [thisArg]) ⇒ Array.<T>
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
f | function |
[thisArg] | * |
staticKnowledgeDataTable.asArray() ⇒ Array.<T>
Kind: instance method of StaticKnowledgeDataTable
staticKnowledgeDataTable.add(item) ⇒ boolean
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
item | T |
staticKnowledgeDataTable.parse(json) ⇒ T
| Object
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
json | object |
staticKnowledgeDataTable.load(data, executor) ⇒ Promise
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
data | Array |
executor | ConcurrentExecutor |
staticKnowledgeDataTable.linkOne(element, json, database, assetManager) ⇒ Promise
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
element | T |
json | object |
database | StaticKnowledgeDatabase |
assetManager | AssetManager |
staticKnowledgeDataTable.link(database, assetManager, executor) ⇒ Promise
Kind: instance method of StaticKnowledgeDataTable
Param | Type |
---|---|
database | StaticKnowledgeDatabase |
assetManager | AssetManager |
executor | ConcurrentExecutor |
staticKnowledgeDataTable.validateOne(element, database, errorConsumer) ⇒ boolean
Kind: instance method of StaticKnowledgeDataTable
Access: protected
Param | Type |
---|---|
element | |
database | StaticKnowledgeDatabase |
errorConsumer | function |
staticKnowledgeDataTable.validate(database, errorConsumer) ⇒ Task
Kind: instance method of StaticKnowledgeDataTable
Returns: Task
- Task succeeds if validation succeeds, and fails if validation fails
Throws:
Error
Param | Type |
---|---|
database | StaticKnowledgeDatabase |
errorConsumer | function |
generate_id(database) ⇒ string
Kind: global function
Param | Type |
---|---|
database | Object |