Savegame
Extends:
Static Method Summary
| Static Public Methods | ||
| public static |
getCurrentVersion(): any |
|
| public static |
getReaderClass(): typeof BaseSavegameInterface |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(app: import("../application").Application, param0: object) |
|
Member Summary
| Public Members | ||
| public |
currentData: import("./savegame_typedefs").SavegameData |
|
| public |
internalId: * |
|
| public |
metaDataRef: * |
|
Method Summary
| Public Methods | ||
| public |
getCurrentDump(): import("./savegame_typedefs").SerializedGame Returns the current game dump |
|
| public |
|
|
| public |
getDefaultData(): import("./savegame_typedefs").SavegameData Returns the savegames default data |
|
| public |
Returns a reader to access the data |
|
| public |
Returns a reader to access external data |
|
| public |
getRealLastUpdate(): * Returns the real last update of the savegame, not the one of the metadata which could also be the servers one |
|
| public |
getStatistics(): import("./savegame_typedefs").SavegameStats Returns the statistics of the savegame |
|
| public |
hasGameDump(): * Returns if this game has a serialized game dump |
|
| public |
Returns if this game can be saved on disc |
|
| public |
migrate(data: import("./savegame_typedefs").SavegameData): * Migrates the savegames data |
|
| public |
saveMetadata(): * Updates the savegames metadata |
|
| public |
setLastUpdate(time: *) Updates the last update field so we can send the savegame to the server, WITHOUT Saving! |
|
| public |
updateData(root: import("../game/root").GameRoot): boolean |
|
| public |
verify(data: import("./savegame_typedefs").SavegameData): * Verifies the savegames data |
|
| public |
writeAsync(): Promise<any> |
|
| public |
Writes the savegame as well as its metadata |
|
Inherited Summary
| From class ReadWriteProxy | ||
| public static |
deserializeObject(text: object): * |
|
| public static |
serializeObject(obj: object): * |
|
| public |
|
|
| public |
|
|
| public |
Store a debounced handler to prevent double writes |
|
| public |
filename: * |
|
| public |
deleteAsync(): Promise<void> Deletes the file |
|
| public |
doWriteAsync(): Promise<void> Actually writes the data asychronously |
|
| public |
|
|
| public |
getDefaultData(): {} |
|
| public |
internalVerifyBasicStructure(data: *): ExplainedResult |
|
| public |
internalVerifyEntry(data: *): ExplainedResult |
|
| public |
migrate(data: *): ExplainedResult |
|
| public |
readAsync(): * |
|
| public |
resetEverythingAsync(): * |
|
| public |
verify(data: *): ExplainedResult |
|
| public |
writeAsync(): Promise<void> Writes the data asychronously, fails if verify() fails. |
|
Static Public Methods
public static getReaderClass(): typeof BaseSavegameInterface source
Return:
| typeof BaseSavegameInterface |
Public Constructors
public constructor(app: import("../application").Application, param0: object) source
Override:
ReadWriteProxy#constructorPublic Members
public currentData: import("./savegame_typedefs").SavegameData source
Override:
ReadWriteProxy#currentDatapublic internalId: * source
public metaDataRef: * source
Public Methods
public getCurrentDump(): import("./savegame_typedefs").SerializedGame source
Returns the current game dump
Return:
| import("./savegame_typedefs").SerializedGame |
public getDefaultData(): import("./savegame_typedefs").SavegameData source
Returns the savegames default data
Override:
ReadWriteProxy#getDefaultDataReturn:
| import("./savegame_typedefs").SavegameData |
public getDumpReaderForExternalData(data: *): BaseSavegameInterface source
Returns a reader to access external data
Params:
| Name | Type | Attribute | Description |
| data | * |
public getRealLastUpdate(): * source
Returns the real last update of the savegame, not the one of the metadata which could also be the servers one
Return:
| * |
public getStatistics(): import("./savegame_typedefs").SavegameStats source
Returns the statistics of the savegame
Return:
| import("./savegame_typedefs").SavegameStats |
public migrate(data: import("./savegame_typedefs").SavegameData): * source
Migrates the savegames data
Override:
ReadWriteProxy#migrateParams:
| Name | Type | Attribute | Description |
| data | import("./savegame_typedefs").SavegameData |
Return:
| * |
public setLastUpdate(time: *) source
Updates the last update field so we can send the savegame to the server, WITHOUT Saving!
Params:
| Name | Type | Attribute | Description |
| time | * |
public updateData(root: import("../game/root").GameRoot): boolean source
Params:
| Name | Type | Attribute | Description |
| root | import("../game/root").GameRoot |
public verify(data: import("./savegame_typedefs").SavegameData): * source
Verifies the savegames data
Override:
ReadWriteProxy#verifyParams:
| Name | Type | Attribute | Description |
| data | import("./savegame_typedefs").SavegameData |
Return:
| * |
public writeAsync(): Promise<any> source
Writes the data asychronously, fails if verify() fails. Debounces the operation by up to 50ms
