Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MultiplayerGameCore

Multliplayer extension for the game core

Hierarchy

Index

Constructors

constructor

Methods

applyGameDump

  • applyGameDump(dump: any): void
  • Applies a dump to the game, effectively synchronizing it

    Parameters

    • dump: any

    Returns void

destruct

  • destruct(): void
  • Destructs the root, freeing all resources

    Returns void

draw

  • draw(): void
  • Returns void

initExistingGame

  • initExistingGame(): boolean
  • Inits an existing game by loading the raw savegame data and deserializing it. Also runs basic validity checks.

    Returns boolean

initNewGame

  • initNewGame(): void
  • Initializes a new game, this means creating a new map and centering on the plaerbase

    Returns void

initRenderLayers

  • initRenderLayers(): void
  • Initializes the render layers. Those are the cached layers for streets and thus

    Returns void

initializeRoot

  • initializeRoot(parentState: any, savegame: any): void
  • Initializes the root object which stores all game related data. The state is required as a back reference (used sometimes)

    Parameters

    • parentState: any
    • savegame: any

    Returns void

interfaceInitFactions

  • interfaceInitFactions(): void

interfaceMakeActionManager

interfaceMakeGameRoot

interfaceMakeGameTime

interfaceMakeWaveManager

internalAddEnemy

  • internalAddEnemy(payload: any): void
  • Parameters

    • payload: any

    Returns void

internalAddResource

  • internalAddResource(payload: any): void
  • Adds a new map resourace

    Parameters

    • payload: any

    Returns void

internalAddStructure

  • internalAddStructure(payload: any): void
  • Parameters

    • payload: any

    Returns void

internalApplyDumpStructures

  • internalApplyDumpStructures(dump: any): void
  • Compares the current game buildings with the buildings stored in the dump and syncs it

    Parameters

    • dump: any

    Returns void

internalInitCanvas

  • internalInitCanvas(): void

internalInitDifficulty

  • internalInitDifficulty(difficulty: any): void
  • Initializes the difficulty. Based on the difficulty we also compute a new balancing object.

    Parameters

    • difficulty: any

    Returns void

internalInitMapLayout

  • internalInitMapLayout(layout: any): void
  • Initializes the map layout. This is a bit hackish since it overrides the global globalConfig.numTiles(X|Y) and such. However, passing those to all classes etc is also a bit annoying.

    Parameters

    • layout: any

    Returns void

internalInitMatchmode

  • internalInitMatchmode(matchmode: any): void
  • Initializes the matchmode, also inits the factions

    Parameters

    • matchmode: any

    Returns void

loadInitialDump

  • loadInitialDump(dump: any): void
  • Loads the initial game dump

    Parameters

    • dump: any

    Returns void

onMapThemeLoaded

  • onMapThemeLoaded(): void
  • Handler when the map theme was finally loaded

    Returns void

postLoadHook

  • postLoadHook(): void

prepareGameOver

  • prepareGameOver(): void
  • Prepares the game to get gameover on next frame

    Returns void

redrawBackgroundLayer

  • redrawBackgroundLayer(chunk: any): Rectangle

requireRoutingUpdate

  • requireRoutingUpdate(): void

resize

  • resize(w: any, h: any): void
  • Parameters

    • w: any
    • h: any

    Returns void

shouldRender

  • shouldRender(): boolean

switchInteractionMode

  • switchInteractionMode(mode: any): void
  • Switches into the given interaction mode

    Parameters

    • mode: any

    Returns void

tick

  • tick(deltaMs: any): boolean
  • Parameters

    • deltaMs: any

    Returns boolean

updateLogic

  • updateLogic(): boolean