Options
All
  • Public
  • Public/Protected
  • All
Menu

The GameApi is used to interact with the game itself, create and list ressources/ship/research... You should use LobbyApi to load it, don't create it yourself

Hierarchy

  • GameApi

Index

Methods

canCreate

  • Check if you can create a certain amount of ship/defense

    Parameters

    • item: Ship | Defense

      Ship or Defense

    • Default value count: number = 1

      The number of items you wants to create

    • Optional resources: ResourceList

      Optional parameter, if provided it will speed up the fonction

    Returns Promise<boolean>

canUpgrade

  • Check if you can upgrade a building

    Parameters

    • building: BuildingLight

      the building to upgrade

    • Optional resources: ResourceList

      Optional parameter, if provided it will speed up the fonction

    Returns Promise<boolean>

createDefense

  • createDefense(defense: Defense, count?: number): Promise<void>
  • Create a defense

    Parameters

    • defense: Defense

      defense to create

    • Default value count: number = 1

      number of defense to create

    Returns Promise<void>

createShip

  • createShip(ship: Ship, count?: number): Promise<void>
  • Create a ship

    Parameters

    • ship: Ship

      ship to create

    • Default value count: number = 1

      number of ship to create

    Returns Promise<void>

defenseList

facilitiesList

makeUpgrade

researchList

resourceFactoryList

resourcesList

shipList

start

  • start(): Promise<void>

stop

  • stop(): Promise<void>
  • Stop the game api. You should called this before exiting your program.

    Returns Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc