128 struct Hand *hand,
const int idCard);
143 struct Hand *hand,
int currentCard);
Player and Team structures, with helper functions.
#define MAX_GAME_PLAYERS
Maximum number of players in a game.
Definition: constants.h:42
EXPORT int game_arrangePlayersRound(struct Game *game, const int i)
Function to add a round to a game and to arrange players into it, according to game rules...
Definition: game.c:358
Hand structure.
Definition: round.h:27
Contains definitions of various symbolic constants.
struct Round * round
Definition: game.h:37
int pointsNumber
Definition: game.h:36
EXPORT int game_updateScore(const struct Game *game, struct Player *bidWinner)
Function to update the score of teams and players after a round.
Definition: game.c:310
Player structure.
Definition: team.h:27
struct Deck * deck
Definition: game.h:40
EXPORT int game_removeTeam(const struct Team *team, struct Game *game)
Removes a team from a game.
Definition: game.c:121
A 28 card deck used in this game.
Definition: deck.h:38
EXPORT int game_removePlayer(const struct Player *player, struct Game *game)
Removes a player from a game.
Definition: game.c:79
Round structure.
Definition: round.h:51
EXPORT struct Team * game_findTeam(const struct Game *game, struct Player *player)
Function to find the team in which a player belongs.
Definition: game.c:292
EXPORT int game_addTeam(struct Team *team, struct Game *game)
Adds a team to a game.
Definition: game.c:99
EXPORT int game_deleteGame(struct Game **game)
Frees the memory of a game and makes the pointer NULL.
Definition: game.c:40
EXPORT struct Game * game_createGame(const int numberPoints)
Allocates memory for and initializes a game.
Definition: game.c:15
EXPORT int game_findNextAllowedCard(struct Player *player, struct Game *game, struct Hand *hand, int currentCard)
Function to find the next allowed card after currentCard. Uses game_checkCard to check if a card is a...
Definition: game.c:280
int numberPlayers
Definition: game.h:35
Game structure.
Definition: game.h:34
struct Player * players[MAX_GAME_PLAYERS]
Definition: game.h:38
EXPORT int game_findPreviousAllowedCard(struct Player *player, struct Game *game, struct Hand *hand, int currentCard)
Function to find the previous allowed card before currentCard. Uses game_checkCard to check if a card...
Definition: game.c:286
In this file are located the definitions of Card and Deck structures, as well as helper functions...
#define MAX_GAME_TEAMS
Maximum number of teams in a game.
Definition: constants.h:47
Round and Hand structures, as well as helper functions.
struct Team * teams[MAX_GAME_TEAMS]
Definition: game.h:39
EXPORT int game_checkCard(struct Player *player, const struct Game *game, struct Hand *hand, const int idCard)
Function checks if the player can put a card down.
Definition: game.c:189
EXPORT int game_addPlayer(struct Player *player, struct Game *game)
Adds a player to a game.
Definition: game.c:53
EXPORT struct Team * game_winningTeam(struct Game *game)
Searches the winning team of a game.
Definition: game.c:140
Team structure.
Definition: team.h:46