4. Game Entities and state - HearthSim/kettle-design GitHub Wiki

Kettle page on hearthsim.net

Relations

Tag

kettle:types/tag object holds a property of a certain entity. It's a key-value object. All tags for a certain entity together represent the state of that entity.

{
    "type": "kettle:types/tag",
    "tag": 
    {
        /*REQ*/ "name" := integer,
        /*REQ*/ "value" := integer,
    }
}

Entity

kettle:types/entity represents something that has a state, inside the game. More explanation about Entities can be found at the IRI section on Entities.

  • EntityID: Identifier of the entity; and
  • Name: The ID of the card. This value is allowed to be empty, which indicates a HIDDEN entity; and
  • Tags: List of properties defining the state of the entity.
{
    "type": "kettle:types/entity",
    "entity": 
    {
        /*REQ*/ "entityID" := kettle:games/[game_id]/entities/[entity_id],
        /*REQ*/ "name" := kettle:cards/[card_id],
        /*REQ*/ "tags" := 
                [
                    kettle:types/tag,
                    kettle:types/tag,
                     ..
                ]
    }
}

Player

kettle:types/player holds information about players participating in the game. More explanation about Players can be found at the IRI section on Players.

  • PlayerID: Identifier of the player; and
  • GameAccountID: The identifier of the game account related to the PlayerID property; and
  • CardBack: The numeric value of the cardback used by this player. See the xml file of all cardbacks for all possible values; and
  • Entity: The entity object of this player.
{
    "type": "kettle:types/player",
    "player": 
    {
        /*REQ*/ "playerID" := kettle:games/[game_id]/players/[player_id], // 1 or 2 (for 2 player games)
        /*REQ*/ "game_accountID" := kettle:accounts/[account_id],
        /*REQ*/ "card_back" := integer,
        /*REQ*/ "entity" := kettle:types/entity,
    }
}