GameEvent

GameEvent

A cancellable game event passed to piece callbacks. Carries a reference to the current player and board so callbacks can read game state and fire messages without needing to import Game.

Constructor

new GameEvent()

Source:

Classes

GameEvent

Members

isCancelled

Description:
  • True if the event has been cancelled.

Source:

True if the event has been cancelled.

Methods

cancel(message, cell)

Description:
  • Cancel with an optional message. If a message is provided, it will be centered on the player’s cell, unless a cell argument is passed to the method.

Source:
Parameters:
Name Type Description
message
cell

kill()

Description:
  • Record that an agent has been killed (changeHealth returned 0). Callers are responsible for removing the agent from the board after processing all callbacks.

Source:

suppressCancel()

Description:
  • Allow a cancelled event to proceed (used by Game controller).

Source: