Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface GameApiContext

Interface allowing communication between client application and specific game contract in Ethereum blockchain.

Hierarchy

  • GameApiContext

Properties

Readonly attack

attack: function

Performs previously commited ATTACK action, with corresponding parameters, returns result of this action

Type declaration

    • (nonce: BigNumber, startBlock: number, target: PlayerRef, item?: ItemRef): Promise<PlayerAttackedEventLog>
    • Parameters

      Returns Promise<PlayerAttackedEventLog>

Readonly claim

claim: function

Converts "product" resource to the game currency after end of last game turn

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

Readonly commit

commit: function

Commits user initiated action in form of its hash and minimal number of blocks in which the action could be performed, and returns block number when the blockchain received this commitment

Type declaration

    • (hash: string, duration: number): Promise<number>
    • Parameters

      • hash: string
      • duration: number

      Returns Promise<number>

Readonly getAllPlayers

getAllPlayers: function

Returns array of currently registered players

Type declaration

    • (): Promise<Address[]>
    • Returns Promise<Address[]>

Readonly getCurrentPlayerCount

getCurrentPlayerCount: function

Returns number of players registered in current game turn

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

Readonly getItem

getItem: function

Returns identifier of item currently spawned at given location, or undefined when there isn't any

Type declaration

    • (location: XY): Promise<string | undefined>
    • Parameters

      • location: XY

      Returns Promise<string | undefined>

Readonly getPlayerInfo

getPlayerInfo: function

Returns current info about given player address, or undefined, if the address is not valid

Type declaration

    • (account: Address): Promise<PlayerInfo | undefined>
    • Parameters

      • account: Address

      Returns Promise<PlayerInfo | undefined>

Readonly goTo

goTo: function

Performs previously commited GOTO action, with corresponding parameters, returns result of this action

Type declaration

    • (nonce: BigNumber, startBlock: number, location: XY, item?: ItemRef): Promise<PlayerMovedEventLog>
    • Parameters

      • nonce: BigNumber
      • startBlock: number
      • location: XY
      • Optional item: ItemRef

      Returns Promise<PlayerMovedEventLog>

Readonly mine

mine: function

Performs previously commited MINE action, with corresponding parameters, returns result of this action

Type declaration

    • (nonce: BigNumber, startBlock: number, item?: ItemRef): Promise<PlayerMinedEventLog>
    • Parameters

      • nonce: BigNumber
      • startBlock: number
      • Optional item: ItemRef

      Returns Promise<PlayerMinedEventLog>

Readonly pickItem

pickItem: function

Picks item spawned at player's current location

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

Readonly refreshPlayer

refreshPlayer: function

Gets current info about given player and stores it into database

Type declaration

Readonly register

register: function

Registers into current game turn with given player skill values (100 in total)

Type declaration

    • (moving: integer, mining: integer, combat: integer): Promise<void>
    • Parameters

      • moving: integer
      • mining: integer
      • combat: integer

      Returns Promise<void>

Generated using TypeDoc