Civilization
Public Member Functions | List of all members
shared::Rules Class Reference

class Rules - More...

#include <Rules.hpp>

Public Member Functions

 Rules ()
 constructor of Rules, define the ruleId of created rule.
 
bool runTheRule (RuleArgsStruct &args)
 This function aim to run the rule of the card. More...
 
std::vector< std::array< unsigned, 2 > > getNeighbors (unsigned posX, unsigned posY, std::shared_ptr< Map > gameMap)
 
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. More...
 
bool isThereACity (std::array< unsigned, 2 > position, std::shared_ptr< Map > gameMap)
 
bool isThereAControlPawn (std::array< unsigned, 2 > position, std::shared_ptr< Map > gameMap)
 
bool isThereACaravan (std::array< unsigned, 2 > position, std::shared_ptr< Map > gameMap)
 

Detailed Description

class Rules -

Member Function Documentation

◆ isThereACityAround()

bool Rules::isThereACityAround ( std::array< unsigned, 2 >  position,
std::shared_ptr< Map gameMap 
)

This function aim to check if there is a city around a position.

Parameters
positionthe position to check
gameMapthe map of the game
Returns
true if there is a city around, false otherwise

◆ runTheRule()

bool Rules::runTheRule ( RuleArgsStruct args)

This function aim to run the rule of the card.

Parameters
args: struct containing all the arguments needed to run the rule

The documentation for this class was generated from the following files: