onGameActionReceived

open fun onGameActionReceived(message: GameAction, sender: String)

Called when an opponent sent a GameActionMessage. This method is supposed to act as a fallback solution if not for all Subclasses of GameAction a dedicated handler was registered using GameActionReceiver annotation.

Register a message receiver for a message type 'ExampleGameAction' by declaring a function

fun yourFunctionName(yourParameterName1 : ExampleGameAction, yourParameterName2: String) { }

The BGW framework will automatically choose a function to invoke based on the declared parameter types.

Parameters

message

The GameAction received from the opponent.

sender

The opponents identification.