|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/**
|
|
|
|
|
* \file Game.h
|
|
|
|
|
* \brief Management of a Game
|
|
|
|
|
* \author Théotime Maillarbaux
|
|
|
|
|
* \author Théotime Maillarbaux, Jacques Thomas
|
|
|
|
|
* \date 29/11/2021
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
@ -11,6 +11,7 @@
|
|
|
|
|
#include "model/Player.h"
|
|
|
|
|
#include "model/Board.h"
|
|
|
|
|
#include <SDL2/SDL_pixels.h>
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \enum Phase
|
|
|
|
@ -41,5 +42,39 @@ typedef struct {
|
|
|
|
|
*/
|
|
|
|
|
Game newGame(const int nbPlayers, const char* pseudos[]);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Move a piece to an island
|
|
|
|
|
* \param[in] p the piece to move
|
|
|
|
|
* \param[in] i island target
|
|
|
|
|
* \return True if the piece can be move otherwise false
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
bool movePiece(Piece p, Island i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Check if the the island is attainable from the piece's position (no player on the island)
|
|
|
|
|
* \param[in] p the piece to move
|
|
|
|
|
* \param[in] i island target
|
|
|
|
|
* \return True if the island is attainable (no player on the island) otherwise false
|
|
|
|
|
*/
|
|
|
|
|
bool checkIsland(Piece p, Island i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \biref Check if there is a bridge at (coord->x; coord->y)
|
|
|
|
|
* \param[in] coords Coords to test
|
|
|
|
|
* \param[in] board Actual game board
|
|
|
|
|
* \return True if there is a bridge. Else return false.
|
|
|
|
|
*/
|
|
|
|
|
bool checkBridge(Coord* coords, Board* board);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Remove bridge from board at (coord->x; coord->y)
|
|
|
|
|
* \param[in] coords Bridge's coords to remove
|
|
|
|
|
* \param[in] board Actual game board
|
|
|
|
|
* \return True on succsess. Else return false.
|
|
|
|
|
*/
|
|
|
|
|
bool rmBridge(Coord* coords, Board* board);
|
|
|
|
|
|
|
|
|
|
#endif //PARTIE_H
|
|
|
|
|