Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Savegame

Hierarchy

Index

Constructors

constructor

  • new Savegame(app: any, __namedParameters: object): Savegame
  • Parameters

    • app: any
    • __namedParameters: object
      • internalId: any
      • metaDataRef: any

    Returns Savegame

Methods

deleteAsync

  • deleteAsync(): any

getCurrentData

  • getCurrentData(): any

getCurrentDump

  • getCurrentDump(): any
  • Returns the current game dump

    Returns any

getCurrentVersion

  • getCurrentVersion(): any

getDefaultData

  • getDefaultData(): object
  • Returns the savegames default data

    Returns object

    • dump: null
    • gameover: boolean
    • lastUpdate: number
    • version: any
    • stats: object
      • buildingsPlaced: number
      • expGained: number
      • zombiesKilled: number

getDifficulty

  • getDifficulty(): any
  • Returns the savegames difficulty

    Returns any

getDumpReader

  • getDumpReader(): any
  • Returns a reader to access the data

    Returns any

getDumpReaderForExternalData

  • getDumpReaderForExternalData(data: any): any
  • Returns a reader to access external data

    Parameters

    • data: any

    Returns any

getMapLayout

  • getMapLayout(): any
  • Returns the savegames layout

    Returns any

getMatchMode

  • getMatchMode(): any
  • Returns the match mode of the game. By default this is the singleplayer mode

    Returns any

getRealLastUpdate

  • getRealLastUpdate(): any
  • Returns the real last update of the savegame, not the one of the metadata which could also be the servers one

    Returns any

getStatistics

  • getStatistics(): any
  • Returns the statistics of the savegame

    Returns any

getSyncKey

  • getSyncKey(): any
  • Returns the synchronization key of the savegame

    Returns any

getSyncPayloadAsync

  • getSyncPayloadAsync(): Promise<object>
  • Returns the serialized data to send to the server

    Returns Promise<object>

getSyncPayloadSync

  • getSyncPayloadSync(): object
  • Returns the serialized data to send to the server

    Returns object

    • savegame: string
    • meta: object
      • difficulty: any
      • map: any
      • syncKey: any

hasGameDump

  • hasGameDump(): boolean
  • Returns if this game has a serialized game dump

    Returns boolean

hasLocalData

  • hasLocalData(): boolean
  • Returns if this savegame has data stored on the disk

    Returns boolean

internalVerifyBasicStructure

internalVerifyEntry

isSaveable

  • isSaveable(): boolean
  • Returns if this game can be saved on disc

    Returns boolean

isSynchronizable

  • isSynchronizable(): boolean
  • Returns if this game can be synced with the server

    Returns boolean

loadServerSavegame

  • loadServerSavegame(serverData: any): any
  • Loads and applies a savegame from the server

    Parameters

    • serverData: any

    Returns any

markGameOver

  • markGameOver(): any
  • Marks the savegame as game over

    Returns any

migrate

readAsync

  • readAsync(): any

resetEverythingAsync

  • resetEverythingAsync(): Promise<string>

saveMetadata

  • saveMetadata(): any
  • Updates the savegames metadata

    Returns any

setLastUpdate

  • setLastUpdate(time: any): void
  • Updates the last update field so we can send the savegame to the server, WITHOUT Saving!

    Parameters

    • time: any

    Returns void

updateData

  • updateData(root: any): boolean
  • Parameters

    • root: any

    Returns boolean

updateSyncKey

  • updateSyncKey(key: any): any
  • Updates the savegames synchronization key

    Parameters

    • key: any

    Returns any

verify

writeAsync

  • writeAsync(): Promise<void> | Promise<string>
  • see

    ReadWriteProxy.writeAsync

    Returns Promise<void> | Promise<string>

writeSavegameAndMetadata

  • writeSavegameAndMetadata(): any
  • Writes the savegame as well as its metadata

    Returns any

Static getCurrentVersion

  • getCurrentVersion(): number
  • Returns number

Static getReaderClass