Skip to main content

Game Card

A game card serves as a relationship between a game and a card and it's player. It references the card it is representing and contains the current state of the card in the game.

Game Card Shape​

interface GameCard {
id: string;

rank: number;
position: GameCardPosition;
/** player id */
player: string;
/** card id */
card: string;
/** whether the card is revealed to everyone */
is_revealed: boolean;
}

As you can see, the game card is a simple object with a few properties.

  • The id property is the unique identifier of the game card.
  • The rank property is the rank of the card in the game (in which order the card will appear at its current position).
  • The position property is the position of the card in the game.
  • The player property is the player id of the player who owns the card.
  • The card property is the card id of the card that the game card is representing.
  • The is_revealed property is a boolean that indicates whether the card is revealed to everyone.

<code references>​

General: