Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GameLogic

Hierarchy

  • GameLogic

Index

Constructors

constructor

  • Parameters

    • root: any

    Returns GameLogic

Methods

canSellBuilding

  • canSellBuilding(building: any): boolean
  • Returns whether a given building can be sold

    Parameters

    • building: any

    Returns boolean

    true if it can get sold

checkBuildingRequirements

  • checkBuildingRequirements(metaBuilding: any, faction: any): boolean
  • Checks if all requirements are satisfied

    Parameters

    • metaBuilding: any
    • faction: any

    Returns boolean

    true if all requirements are satisfied

checkHasAllResourcesForBlueprint

  • checkHasAllResourcesForBlueprint(metaBuilding: any, faction: any): boolean
  • Checks if all required blueprint resources are produced

    Parameters

    • metaBuilding: any
    • faction: any

    Returns boolean

checkIsExploredByFaction

  • checkIsExploredByFaction(tile: any, faction: any): any
  • Checks if a tile is explored from the given faction

    Parameters

    • tile: any
    • faction: any

    Returns any

checkIsInVisionByFaction

  • checkIsInVisionByFaction(tile: any, faction: any): any
  • Checks if a tile is in vision from the given faction

    Parameters

    • tile: any
    • faction: any

    Returns any

checkRequirementsAndBlueprintResources

  • checkRequirementsAndBlueprintResources(metaBuilding: any, faction: any): boolean
  • Checks if there are all resources available for the given meta building, and no restrictions which fail. Used by the buildings category dialog

    Parameters

    • metaBuilding: any
    • faction: any

    Returns boolean

checkResourceIsProduced

  • checkResourceIsProduced(resourceId: any, faction: any): boolean
  • Checks if a given resource id is somehow getting produced

    Parameters

    • resourceId: any
    • faction: any

    Returns boolean

countBuildingsOfType

  • countBuildingsOfType(metaClass: any, faction: any): number
  • Counts all buildings + blueprints of the given meta class and faction

    Parameters

    • metaClass: any
    • faction: any

    Returns number

    amount of buildings

getFactionArmySizes

  • getFactionArmySizes(faction: any): object
  • Returns how many enemies of each id are contained in the factions army

    Parameters

    • faction: any

    Returns object

    • countsById: object
    • pendingById: object
    • pendingCount: number
    • totalCount: number

getFactionPlayerBase

  • getFactionPlayerBase(faction: any): any
  • Returns the factions base

    Parameters

    • faction: any

    Returns any

getLocalPlayerBase

  • getLocalPlayerBase(): any
  • Returns the players base

    Returns any

getMapThemeConfig

  • getMapThemeConfig(): any
  • Dunno, didn'T find a better spot. Returns the current map theme id

    Returns any

internalCheckResourceIsProduced

  • internalCheckResourceIsProduced(resourceId: any, faction: any): boolean
  • Checks if a given resource id is somehow getting produced. UNCACHED.

    Parameters

    • resourceId: any
    • faction: any

    Returns boolean

internalDestroyEntityLocalClientOnly

  • internalDestroyEntityLocalClientOnly(entity: any, doAsync?: boolean): void
  • Destroys an entity (local client only)

    Parameters

    • entity: any
    • Default value doAsync: boolean = true

      whether to do it async

    Returns void

internalDestroyStructureLocalClientOnly

  • internalDestroyStructureLocalClientOnly(building: any, doAsync?: boolean): void
  • Destroys a building (local client only)

    Parameters

    • building: any
    • Default value doAsync: boolean = true

      whether to do it async

    Returns void

internalPlaceBlueprintLocalClientOnly

  • internalPlaceBlueprintLocalClientOnly(__namedParameters: object): Blueprint
  • Places the blueprint instance class of the given meta building at the given tile. LOCAL client only!

    Parameters

    • __namedParameters: object
      • faction: any
      • metaBuilding: any
      • tile: any
      • uid: any

    Returns Blueprint

internalPlaceBuildingLocalClientOnly

  • internalPlaceBuildingLocalClientOnly(__namedParameters: object): any
  • Places the instance class of the given meta building at the given tile. LOCAL client only!

    Parameters

    • __namedParameters: object
      • faction: any
      • metaBuilding: any
      • tile: any
      • uid: any

    Returns any

internalPlaceMapEntityLocalClientOnly

  • internalPlaceMapEntityLocalClientOnly(tile: any, entity: any, uid?: any): any
  • Places the given entity on the position of the map and registers it

    Parameters

    • tile: any
    • entity: any
    • Default value uid: any = null

    Returns any

internalRecomputeProducedResourcesCache

  • internalRecomputeProducedResourcesCache(): void
  • Recomputes the resource production cache

    Returns void

internalUnlockUpgradeLocalClientOnly

  • internalUnlockUpgradeLocalClientOnly(building: any, upgrade: any): boolean
  • Internal helper to unlock an upgrade (local client only)

    Parameters

    • building: any
    • upgrade: any

    Returns boolean

makeActionToDestroyStructure

  • Makes an action to destroy a structure

    Parameters

    • __namedParameters: object
      • faction: any
      • structure: any
      • userInitiated: boolean

    Returns DestroyBuildingClientAction

makeActionToUnlockUpgrade

  • Makes an action to unlock an upgrade

    Parameters

    • __namedParameters: object
      • building: any
      • upgradeId: any

    Returns UnlockUpgradeClientAction

spawnEnemy

  • spawnEnemy(__namedParameters: object): any
  • Spawns a new enemy of the given faction (Enemys only attack buildings of the same faction, this is a bit counterintuitive but makes a lot of sense for multiplayer)

    Parameters

    • __namedParameters: object
      • faction: any
      • metaClass: any
      • payload: any
      • uid: any
      • worldPos: any

    Returns any