new Card(text, action)
The Card class
Parameters:
Name | Type | Description |
---|---|---|
text |
string | The card's message |
action |
function | An action to be taken when the card is drawn. action should take the game state as a parameter |
Extends
Methods
sendMessage(message) → {void}
Method to broadcast a message out to the other components
Parameters:
Name | Type | Description |
---|---|---|
message |
string | Message to send |
- Inherited From:
- Source:
Returns:
- Type
- void
subscribe(callback) → {void}
Method to subscribe to messages
Parameters:
Name | Type | Description |
---|---|---|
callback |
func | A callback method to pass the message to |
- Inherited From:
- Source:
Returns:
- Type
- void