Next: , Previous: , Up: Programming with libtarot   [Contents][Index]


4.5 Describing a game

enum: TarotStep

The current step of a game.

struct: TarotCardAnalysis \TarotCard card; int cannot_follow, int cannot_overtrump, int cannot_undertrump \

Card that has been played, with posterior information.

Function: TarotStep tarot_game_step (const TarotGame *game)
Function: size_t tarot_game_n_players (const TarotGame *game)
Function: int tarot_game_with_call (const TarotGame *game)
Function: size_t tarot_game_n_tricks (const TarotGame *game)

Query the properties of game that are always set: its current step, the number of players, whether there is a call.

Function: TarotGameError tarot_game_get_next (const TarotGame *game, TarotPlayer *next)
Function: TarotGameError tarot_game_get_main_player (const TarotGame *game, TarotPlayer *main)
Function: TarotGameError tarot_game_get_deal_all (const TarotGame *game, size_t *n, size_t start, size_t max, TarotPlayer *owners)
Function: TarotGameError tarot_game_get_deal_all_alloc (const TarotGame *game, size_t *n, TarotPlayer **owners)
Function: TarotGameError tarot_game_get_deal_of (const TarotGame *game, TarotPlayer who, size_t *n, size_t start, size_t max, TarotCard *cards)
Function: TarotGameError tarot_game_get_deal_of_alloc (const TarotGame *game, TarotPlayer who, size_t *n, TarotCard **cards)
Function: TarotGameError tarot_game_get_cards (const TarotGame *game, TarotPlayer who, size_t *n, size_t start, size_t max, TarotCard *cards)
Function: TarotGameError tarot_game_get_cards_alloc (const TarotGame *game, TarotPlayer who, size_t *n, TarotCard **cards)
Function: TarotGameError tarot_game_get_bids (const TarotGame *game, size_t *n, size_t start, size_t max, TarotBid *bids)
Function: TarotGameError tarot_game_get_bids_alloc (const TarotGame *game, size_t *n, TarotBid **bids)
Function: TarotGameError tarot_game_get_taker (const TarotGame *game, TarotPlayer *taker)
Function: TarotGameError tarot_game_get_declarations (const TarotGame *game, size_t *n, size_t start, size_t max, int *decls)
Function: TarotGameError tarot_game_get_declarations_alloc (const TarotGame *game, size_t *n, int **decls)
Function: TarotGameError tarot_game_get_declarant (const TarotGame *game, TarotPlayer *declarant)
Function: TarotGameError tarot_game_get_call (const TarotGame *game, TarotCard *card)
Function: TarotGameError tarot_game_get_partner (const TarotGame *game, TarotPlayer *partner)
Function: TarotGameError tarot_game_get_dog (const TarotGame *game, size_t *n, size_t start, size_t max, TarotCard *cards)
Function: TarotGameError tarot_game_get_dog_alloc (const TarotGame *game, size_t *n, TarotCard **cards)
Function: TarotGameError tarot_game_get_full_discard (const TarotGame *game, size_t *n, size_t start, size_t max, TarotCard *cards)
Function: TarotGameError tarot_game_get_full_discard_alloc (const TarotGame *game, size_t *n, TarotCard **cards)
Function: TarotGameError tarot_game_get_public_discard (const TarotGame *game, size_t *n, size_t start, size_t max, TarotCard *cards)
Function: TarotGameError tarot_game_get_public_discard_alloc (const TarotGame *game, size_t *n, TarotCard **cards)
Function: TarotGameError tarot_game_get_handful (const TarotGame *game, TarotPlayer p, int *size, size_t *n, size_t start, size_t max, TarotCard *cards)
Function: TarotGameError tarot_game_get_handful_alloc (const TarotGame *game, TarotPlayer p, int *size, size_t *n, TarotCard **cards)
Function: TarotGameError tarot_game_get_current_trick (const TarotGame *game, size_t *current)
Function: TarotGameError tarot_game_get_lead_suit (const TarotGame *game, size_t i_trick, TarotSuit *lead_suit)
Function: TarotGameError tarot_game_get_max_trump (const TarotGame *game, size_t i_trick, TarotNumber *max_trump)
Function: TarotGameError tarot_game_get_trick_leader (const TarotGame *game, size_t i_trick, TarotPlayer *leader)
Function: TarotGameError tarot_game_get_trick_taker (const TarotGame *game, size_t i_trick, TarotPlayer *taker)
Function: TarotGameError tarot_game_get_trick_cards (const TarotGame *game, size_t i_trick, size_t *n, size_t start, size_t max, TarotGameCardAnalysis *cards)
Function: TarotGameError tarot_game_get_trick_cards_alloc (const TarotGame *game, size_t i_trick, size_t *n, TarotGameCardAnalysis **cards)
Function: TarotGameError tarot_game_get_points_in_trick (const TarotGame *game, size_t i_trick, unsigned int *halfpoints, unsigned int *oudlers)
Function: TarotGameError tarot_game_get_scores (const TarotGame *game, size_t *n, size_t start, size_t max, int *scores)
Function: TarotGameError tarot_game_get_scores_alloc (const TarotGame *game, size_t *n, int **cards)

Query a property of game that may or may not be relevant at evry moment of the game. Return ‘TAROT_GAME_OK’ on success, or ‘TAROT_GAME_NA’ if it is not relevant.

tarot_game_get_main_player’ queries the main player that have been dealt cards; in case of a deal for all players it is not set.

Some properties are still set to a meaningful value, even if the return value is ‘TAROT_GAME_NA’, such as the taker for ‘tarot_game_get_taker’ and ‘tarot_game_get_trick_taker’.

Function: TarotGameError tarot_game_get_hint_bid (const TarotGame *game, TarotPlayer *player, TarotBid *mini)
Function: TarotGameError tarot_game_get_hint_decl (const TarotGame *game, TarotPlayer *player, int *allowed)
Function: TarotGameError tarot_game_get_hint_call (const TarotGame *game, TarotPlayer *player, int *mini)
Function: TarotGameError tarot_game_get_hint_discard (const TarotGame *game, TarotPlayer *player, size_t *n_cards, size_t *n_prio, size_t start_prio, size_t max_prio, TarotCard *prio, size_t *n_additional, size_t start_additional, size_t max_additional, TarotCard *additional)
Function: TarotGameError tarot_game_get_hint_discard_alloc (const TarotGame *game, TarotPlayer *player, size_t *n_cards, size_t *n_prio, TarotCard **prio, size_t *n_additional, TarotCard **additional)
Function: TarotGameError tarot_game_get_hint_handful (const TarotGame *game, TarotPlayer *player, size_t *n_simple, size_t *n_double, size_t *n_triple, size_t *n_prio, size_t start_prio, size_t max_prio, TarotCard *prio, size_t *n_additional, size_t start_additional, size_t max_additional, TarotCard *additional)
Function: TarotGameError tarot_game_get_hint_handful_alloc (const TarotGame *game, TarotPlayer *player, size_t *n_simple, size_t *n_double, size_t *n_triple, size_t *n_prio, TarotCard **prio, size_t *n_additional, TarotCard **additional)
Function: TarotGameError tarot_game_get_hint_card (const TarotGame *game, TarotPlayer *player, size_t *n_playable, size_t start_playable, size_t max_playable, TarotCard *playable)
Function: TarotGameError tarot_game_get_hint_card_alloc (const TarotGame *game, TarotPlayer *player, size_t *n_playable, TarotCard **playable)

Query what can happen next in game. The next player to play is also set.


Next: , Previous: , Up: Programming with libtarot   [Contents][Index]