2 #ifndef SHARED__RULES__H 
    3 #define SHARED__RULES__H 
   18 #include "Caravan.hpp" 
   20 #include "CardsEnum.hpp" 
   21 #include "RuleArgsStruct.hpp" 
   31     std::vector<std::array<unsigned, 2>> getNeighbors (
unsigned posX, 
unsigned posY, std::shared_ptr<Map> gameMap);
 
   32     bool isThereACityAround (std::array<unsigned, 2> position, std::shared_ptr<Map> gameMap);
 
   33     bool isThereACity (std::array<unsigned,2> position, std::shared_ptr<Map> gameMap);
 
   34     bool isThereAControlPawn (std::array<unsigned, 2> position, std::shared_ptr<Map> gameMap);
 
   35     bool isThereACaravan (std::array<unsigned,2> position, std::shared_ptr<Map> gameMap);
 
   37     bool moveCaravan (std::vector<std::shared_ptr<Caravan>> caravans, std::array<unsigned,2>  pos1, std::array<unsigned,2>  pos2, std::shared_ptr<Map> map, std::shared_ptr<Player> currentPlayer);
 
   38     void exchangeRessourceWithOtherPlayer ();
 
   39     void playAnotherCard ();
 
   40     void reinforcePawn ();
 
   46     bool verifyIfPathIsValid (std::vector<
int[2]> caravanMovementPath, 
int maxLevelReachable);
 
   47     std::vector<std::shared_ptr<std::variant<Caravan,Barbarian,BarbarianVillage,ControlPawn,City>>> checkIfBarbarianIsOnThePath (std::vector<std::array<unsigned,2>> caravanMovementPath, std::shared_ptr<Map> map);
 
   48     bool checkIfWaterIsOnThePath (std::vector<std::array<unsigned,2>> caravanMovementPath, std::shared_ptr<Map> map);
 
   49     void nuke (std::vector<std::array<unsigned, 2>> neighbors, std::shared_ptr<Map> gameMap, std::shared_ptr<Player> currentPlayer);
 
   50     bool placeControlPawns (std::vector<std::array<unsigned, 2>> positions, std::shared_ptr<Map> gameMap, std::shared_ptr<Player> currentPlayer);
 
   55     bool verifyIfPathSizeIsCorrect (
int pathSize, 
int maxSize);
 
   56     void addCaravanAfterCardAmelioration (std::vector<std::shared_ptr<Caravan>> & caravans, std::shared_ptr<shared::Player> currentPlayer, 
int numberOfCaravans);
 
   57     void roundCards (std::shared_ptr<Player> currentPlayer, CardsEnum cardPlayed);
 
   58     void killControlPawn (std::shared_ptr<Map> gameMap, std::array<unsigned, 2> position, std::shared_ptr<Player> currentPlayer);
 
class RuleArgsStruct -
Definition: RuleArgsStruct.hpp:25
class Rules -
Definition: Rules.hpp:26
Rules()
constructor of Rules, define the ruleId of created rule.
Definition: Rules.cpp:29
bool isThereACityAround(std::array< unsigned, 2 > position, std::shared_ptr< Map > gameMap)
This function aim to check if there is a city around a position.
Definition: Rules.cpp:551
bool runTheRule(RuleArgsStruct &args)
This function aim to run the rule of the card.
Definition: Rules.cpp:39