103 const struct Round *round);
128 const int handId,
struct Round *round);
192 struct Round *round);
233 const struct Round *round);
Player and Team structures, with helper functions.
#define MAX_GAME_PLAYERS
Maximum number of players in a game.
Definition: constants.h:42
This file contains definitions of the symbolic constants that represents error codes, as wel the declarations of the functions that belongs to the error module.
EXPORT int round_findPlayerIndexRound(const struct Player *player, const struct Round *round)
Helper to find player in a round.
Definition: round.c:93
EXPORT int round_removePlayer(const struct Player *player, struct Round *round)
Removes a player from a round.
Definition: round.c:184
EXPORT int round_deleteHand(struct Hand **hand)
Frees the memory of a hand. Makes pointer NULL.
Definition: round.c:65
Hand structure.
Definition: round.h:27
EXPORT int round_removePlayerHand(const struct Player *player, struct Hand *hand)
Removes a player from a hand.
Definition: round.c:201
struct Card * cards[MAX_GAME_PLAYERS]
Definition: round.h:28
EXPORT int round_distributeDeck(struct Deck *deck, const struct Round *round)
Distributes cards to players.
Definition: round.c:355
#define MAX_HANDS
Maximum number of hands in a round.
Definition: constants.h:37
EXPORT int round_putCard(struct Player *player, const int cardId, const int handId, struct Round *round)
Places a card from a player to a hand and offers the player 20 points if has 3 and 4 of same suit or ...
Definition: round.c:217
Contains definitions of various symbolic constants.
struct Player * players[MAX_GAME_PLAYERS]
Definition: round.h:29
struct Card * hand[MAX_CARDS]
Definition: team.h:29
Player structure.
Definition: team.h:27
int bids[MAX_GAME_PLAYERS]
Definition: round.h:54
EXPORT struct Player * round_getBidWinner(const struct Round *round)
Finds the winner of a bid in a round.
Definition: round.c:78
Suit
Constants for suit.
Definition: constants.h:54
Card structure, to keep suit and value.
Definition: deck.h:24
EXPORT int round_findNextAllowedBid(struct Round *round, int currentBid)
Function to find the next allowed bid after currentBid.
Definition: round.c:495
EXPORT int round_arrangePlayersHand(struct Round *round, int i)
The function arranges the players in a hand.
Definition: round.c:381
EXPORT int round_addPlayer(struct Player *player, struct Round *round)
Add a player to a round.
Definition: round.c:138
EXPORT int round_computePoints(const struct Team *team, const struct Round *round)
Compute round points of a team.
Definition: round.c:405
A 28 card deck used in this game.
Definition: deck.h:38
struct Player * players[MAX_GAME_PLAYERS]
Definition: round.h:55
EXPORT int round_placeBid(const struct Player *player, const int bid, struct Round *round)
Places the bid of a player.
Definition: round.c:111
Round structure.
Definition: round.h:51
struct Hand * hands[MAX_HANDS]
Definition: round.h:53
EXPORT struct Round * round_createRound()
Allocates memory for and initializes a round.
Definition: round.c:15
EXPORT int round_distributeCard(struct Deck *deck, const struct Round *round)
Distributes one card to every player.
Definition: round.c:319
EXPORT int round_deleteRound(struct Round **round)
Frees the memory of a round. Makes NULL pointer.
Definition: round.c:38
EXPORT struct Hand * round_createHand()
Allocates memory for and initializes a hand.
Definition: round.c:51
int pointsNumber[MAX_GAME_PLAYERS]
Definition: round.h:56
enum Suit trump
Definition: round.h:52
EXPORT int round_findPreviousAllowedBid(struct Round *round, int currentBid)
Function to find the previous allowed bid before currentBid.
Definition: round.c:500
In this file are located the definitions of Card and Deck structures, as well as helper functions...
EXPORT int round_addPlayerHand(struct Player *player, struct Hand *hand)
Adds a player to a hand.
Definition: round.c:161
EXPORT struct Player * round_handWinner(const struct Hand *hand, struct Round *round)
Determines the winner of a hand.
Definition: round.c:280
EXPORT int round_getMaximumBid(struct Round *round)
The function search the maximum bid.
Definition: round.c:429
Team structure.
Definition: team.h:46