The Game class must implement the following method:
An Object with these properties:
Property name | Type | Value |
command | String |
One of the following:
|
data | Object | Dependant on the command property. See the table below. |
The allowed pairs of command and data properties are the following:
command | data | Description |
"start" | Array of Array of Player objects | Ask to start a new game with the teams specified in the data property |
"info" | undefined | Require infos about the game |
"human_play" | HumanPlay | Play the specified human card |
"next" | undefined | Ask for the next event |
An Object with these properties:
Property name | Type | Value |
type | String |
One of the following:
|
name | String | Player's name |
An Object with these properties:
Property name | Type | Value |
player | String | The name of the human player who is moving |
card | String | The id of the card which is playing |
take | Number | The index of the cards to take. take property is optional: if there is more than one possible take, a choice info is returned inside the Response object. |
An Object with these properties:
Property name | Type | Value |
infos | Array of Info objects | A list of Informations about the current response |
moves | Array of Move objects | A list of Objects representing the cards to move |
cards | Array of CardsGroup objects | A list of CardsGroups to be updated (before cards movements) |
An Object with these properties:
Property name | Type | Value |
info | String |
One of the following:
|
data | Object | Dependant on the info property. See the table below. |
The allowed pairs of info and data properties are the following:
info | data | Description |
"first_player" | String | data is the name of the first player of the match |
"winner" | Array of String | List of the players who won the game |
"waiting" | String | Waiting for move from human player with name data |
"summary" | Array of Summary objects | Match summary |
"choice" | Choice | List of possible takes |
"info" | GameInfo | Informations about the game class |
"cards_definition" | Array of CardsGroup objects | Define all cards groups on match start |
"scopa" | String | data is the name of the player who made scopa |
"cards_value_lt_10" | String | data is the name of the player with cards of values less than 10 |
"2_equal_cards" | String | data is the name of the player with 2 equal cards |
"3_equal_cards" | String | data is the name of the player with 3 equal cards |
An Object with these properties:
Property name | Type | Value |
players | Array of String | List of players of the team |
primiera | Number | Primiera value |
cards | Number | Cards count (between 0 and 40) |
seven_of_coins | Number | 1 if the team took the seven of coins, else 0 |
coins | Number | Number of coins (between 0 and 10) |
scopa | Number | Number of scopa |
re_bello | Number | 1 if the team took the king of coins, else 0 |
partial | Number | Points of the match |
partial | Number | Total points of the game |
An Object with these properties:
Property name | Type | Value |
player | String | The name of the player who have to choose which cards take |
takes | Array of Array of Card objects | List of possible takes |
An Object with these properties:
Property name | Type | Value |
name | String | Name of the game |
number_of_players | Array of Array of Number | List of pairs of the allowed number of teams and players per team |
description | String | Description of the game |
An Object with these properties:
Property name | Type | Value |
type | String | One of the following:
|
id | String | A unique identifier |
length | Number | The number of cards inside the group |
owners | Array of String | List of group owners' names |
covered | Boolean | Indicate whether the cards are covered (valid only if type is "hand") |
side_cards | Array of Card objects | List of cards to show next to the deck (valid only if type is "deck") |
An Object with these properties:
Property name | Type | Value |
source | String | The id of the source CardsGroup |
dest | String | The id of the destination CardsGroup |
cards | Array of Card objects | List of the cards to be moved |
visible | Boolean | Indicate whether tha cards are visible to all players or not |
move_on | Card | Card of the destination group where move cards on |
visible_to | String | The name of the only player who can see this cards, valid only if visible is false |
An Object with these properties:
Property name | Type | Value |
suit | Number | The suit of the card (between 0 and 3) |
value | Number | The value of the card (between 1 and 10) |
id | String | A unique identifier |
new_value | Number | The new value of the card (between 1 and 10) |
Suits are mapped as follows:
Value of the suit property | Italian suit | French suit |
0 | Coins | Diamonds |
1 | Cups | Hearths |
2 | Clubs | Clubs |
3 | Swords | Spades |