66 #define NB_POSSIBLE_FILLINGS 6 81 typedef struct game_s*
game;
90 typedef const struct game_s*
cgame;
121 int required_nb_ghosts,
int required_nb_vampires,
int required_nb_zombies);
content get_content(cgame game, int col, int line)
get the content of a square in the board
game setup_new_game(int *labels[NB_DIR], content *board, int required_nb_ghosts, int required_nb_vampires, int required_nb_zombies)
creates a game from a board description. It uses a given board possibly with its mirrors, and a list of labels.
content_e
possible contents of a square on the board. MIRROR stands for a mirror at +45 degrees (/)...
Definition: game.h:64
bool add_monster(game game, content monster, int col, int line)
adds a monster on the game board. Can also be used to remove any monster by adding EMPTY...
struct game_s * game
The structure pointer that stores the game.
Definition: game.h:81
void add_mirror(game game, int dir, int col, int line)
adds a mirror on the game board
game copy_game(cgame g_src)
Clone the game g_src.
void set_required_nb_monsters(game game, content monster, int value)
modifies the aimed number of a given monster on the board
int required_nb_monsters(cgame game, content monster)
indicates the aimed number of a given monster on the board
void delete_game(game g)
Destroy the game and free allocated memory.
enum direction_e direction
the fourth cardinal directions
direction_e
the fourth cardinal directions
Definition: game.h:72
bool is_game_over(cgame g)
Test if the game is over (that is the grid is filled according to the requirements).
enum content_e content
possible contents of a square on the board. MIRROR stands for a mirror at +45 degrees (/)...
void restart_game(game g)
Restart a game by cleaning monsters from the board.
int current_nb_monsters(cgame game, content monster)
counts the current number of monsters of a given type
int required_nb_seen(cgame game, direction side, int pos)
return the label on the side of the board
void set_required_nb_seen(game game, direction side, int pos, int value)
sets the label of a game
const struct game_s * cgame
The structure constant pointer that stores the game That means that it is not possible to modify the ...
Definition: game.h:90
game new_game()
creates an empty game with all squares set to empty, all labels and the number of required monsters s...
int current_nb_seen(cgame game, direction side, int pos)
says how many monsters can be seen on the current game board