123 #define NB_INITIAL_PIECES 2 317 return_code
place_piece(board game, size piece, player player,
int column);
348 return_code
pick_piece(board game, player current_player,
int line,
int column);
388 return_code
move_piece(board game, direction direction);
407 return_code
swap_piece(board game,
int target_line,
int target_column);
forbidden request
Definition: board.h:135
player next_player(player current_player)
return the next player
int southmost_occupied_line(board game)
Returns the most southern line number which contains a piece.
int northmost_occupied_line(board game)
Returns the northmost line number which contains a piece.
return_code cancel_movement(board game)
cancels the current movement of the player, putting the piece back where it started.
return_code swap_piece(board game, int target_line, int target_column)
swap the current piece with the piece below it, and place the piece below at the given position...
direction_e
the different directions in the game. GOAL is legal only on the northmost line for south player...
Definition: board.h:98
player picked_piece_owner(board game)
returns the player whose piece is currently moving
return_code_e
error codes returned by the function
Definition: board.h:129
size get_piece_size(board game, int line, int column)
returns the size of the piece at the precised position on the board, if any.
given space should or should not be empty
Definition: board.h:133
size picked_piece_size(board game)
returns the size of the piece currently moving (if any)
return_code pick_piece(board game, player current_player, int line, int column)
Select a piece to start with.
success
Definition: board.h:131
size 3
Definition: board.h:66
return_code place_piece(board game, size piece, player player, int column)
places a piece on the board, during the initial setting up of the game.
bool is_move_possible(board game, direction direction)
Indicates whether a move is possible.
int movement_left(board game)
returns the number of movement units left to the current moving piece
no size, for representing no piece
Definition: board.h:63
int picked_piece_line(board game)
returns the line number of the piece currently moving (if any).
return_code move_piece(board game, direction direction)
Moves the current picked piece, if possible.
return_code cancel_step(board game)
cancels the last step of the current move.
The board of the game, define it as you wish.
Definition: modele_board.c:16
int nb_pieces_available(board game, size piece, player player)
Indicates whether the size of piece is still to be placed by the suggested player.
struct board_s * board
Pointer to the structure that holds the game.
Definition: board.h:53
size 1
Definition: board.h:64
player get_winner(board game)
Tells if the game has a winner.
void destroy_game(board game)
Delete the game and frees all required memory.
Definition: modele_board.c:27
int picked_piece_column(board game)
returns the column number of the piece currently moving (if any)
invalid parameter
Definition: board.h:139
size 2
Definition: board.h:65
board copy_game(board original_game)
Makes a deep copy of the game.
sizes_e
the different sizes of pieces.
Definition: board.h:61
board new_game()
Defines a new empty board for starting a game of gobblet-gobblers.
Definition: modele_board.c:20
players_e
the different players for further reference. NO_PLAYER is used when informing that a square is empty...
Definition: board.h:88