DataManager Class
Manages the game's data like loading documents. Documents are stored
in the data folder of the game in JSON format. The UID is used as the file-name.
A document has the following structure:
UID - Unique Identifier
Items -> An object containing all the items/fields of the document.
Items.Type -> The type of the document
Items.Name -> The name of the document
Item Index
Methods
Properties
Methods
disposeDocumentsByType
-
type
Unloads all documents with a specified type.
Parameters:
-
type
String- The document type.
getDocument
-
uid
Gets a document by its UID.
Parameters:
-
uid
String- The UID of the document to get.
Returns:
The document or null if a document with the specified UID doesn't exist.
getDocumentByType
-
type
Gets the first document with the specified type.
Parameters:
-
type
String- The document type.
Returns:
The document or null if a document with the specified type doesn't exist.
getDocumentsByType
-
type
Gets all documents with a specified type.
Parameters:
-
type
String- The document type.
Returns:
The documents.
getDocumentSummary
-
uid
Gets a document by its UID. If the document isn't already loaded this method only returned document only contains summary data.
Parameters:
-
uid
String- The UID of the document to get.
Returns:
The document or null if a document with the specified UID doesn't exist.
update
()
Updates the loading process of documents.
Properties
documents
gs.Document
Stores all documents.
documentsByUid
gs.Document
Stores all documents by UID.
documentsLoaded
Boolean
Indiciates if all requested documents are loaded.