Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SavegameSerializer

Allows to serialize a savegame

Hierarchy

  • SavegameSerializer

Index

Constructors

constructor

Methods

deserialize

  • Tries to load the savegame from a given dump

    Parameters

    • savegame: any
    • root: any

    Returns ExplainedResult

generateDumpFromGameRoot

  • generateDumpFromGameRoot(root: any, sanityChecks?: boolean): object
  • Serializes the game root into a dump

    Parameters

    • root: any
    • Default value sanityChecks: boolean = true

      Whether to check for validity

    Returns object

    • buildingUnlockTracker: any
    • camera: any
    • destroyIndicators: any
    • entities: object
    • entityMgr: any
    • projectiles: any
    • time: any
    • tutorial: any
    • waves: any

migrate

  • Migrates the given dump?

    Parameters

    • data: any

    Returns ExplainedResult

migration_migrateComponent

  • migration_migrateComponent(savegame: any, componentHandle: any, modifier: any): void
  • Performs a function on each component (useful to add / remove / alter properties for migration)

    Parameters

    • savegame: any
    • componentHandle: any
    • modifier: any

    Returns void

migration_migrateGenericObjectPool

  • migration_migrateGenericObjectPool(pools: any, targetClassKey: any, modifier: any): void
  • Performs an operation on each object which is a PooledObject (usually Projectiles). Useful to perform migrations

    Parameters

    • pools: any
    • targetClassKey: any
    • modifier: any

    Returns void

verifyLogicalErrors

  • Verifies if there are logical errors in the savegame

    Parameters

    • savegame: any

    Returns ExplainedResult