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
idproperty is the unique identifier of the game card. - The
rankproperty is the rank of the card in the game (in which order the card will appear at its current position). - The
positionproperty is the position of the card in the game. - The
playerproperty is the player id of the player who owns the card. - The
cardproperty is the card id of the card that the game card is representing. - The
is_revealedproperty is a boolean that indicates whether the card is revealed to everyone.
<code references>â
General: