Represents the overall growth and management of the city. More...
#include <CityGrowth.h>
Public Member Functions | |
| CityGrowth () | |
| Default constructor for CityGrowth. | |
| ~CityGrowth () | |
| Destructor for CityGrowth. | |
| void | addSector () |
| Adds a new sector to the city growth management. | |
| void | addSector (CitySector *sector) |
| Adds an existing sector to the city growth management. | |
| bool | addBuilding (Building *building, int sectorId) |
| Adds a building to a specified sector. | |
| int | getTotalBuildingCount () |
| Gets the total count of buildings across all sectors. | |
| int | getTotalSectorCount () |
| Gets the total count of sectors in the city. | |
| std::vector< CitySector * > | getSectors () |
| Gets a vector of pointers to the sectors in the city. | |
| std::string | printSectors () |
| Prints information about all sectors in the city. | |
| void | printSectorsCitizens (int sectorID) |
| Prints the citizens in a specified sector. | |
| void | setRoads (RoadSystemAdapter *rs) |
| Sets the road system for the city. | |
Public Member Functions inherited from CitySector | |
| ~CitySector () | |
| Destructor for CitySector. | |
| void | addBuilding (Building *building) |
| Adds a building to the city sector. | |
| int | getBuildingCount () |
| Gets the count of buildings in the sector. | |
| const std::vector< Building * > & | getBuildings () const |
| Gets a constant reference to the vector of buildings in the sector. | |
| std::vector< Building * > | getBlock () |
| Gets a vector representing the block of buildings. | |
Represents the overall growth and management of the city.
The CityGrowth class inherits from CitySector and manages multiple city sectors. It handles the addition of sectors and buildings, tracks total building and sector counts, and manages city infrastructure such as roads.
| bool CityGrowth::addBuilding | ( | Building * | building, |
| int | sectorId ) |
Adds a building to a specified sector.
| building | A pointer to the Building object to be added. |
| sectorId | The identifier of the sector where the building should be added. |
| void CityGrowth::addSector | ( | CitySector * | sector | ) |
Adds an existing sector to the city growth management.
| sector | A pointer to the CitySector object to be added. |
| std::vector< CitySector * > CityGrowth::getSectors | ( | ) |
Gets a vector of pointers to the sectors in the city.
| int CityGrowth::getTotalBuildingCount | ( | ) |
Gets the total count of buildings across all sectors.
| int CityGrowth::getTotalSectorCount | ( | ) |
Gets the total count of sectors in the city.
| std::string CityGrowth::printSectors | ( | ) |
Prints information about all sectors in the city.
| void CityGrowth::printSectorsCitizens | ( | int | sectorID | ) |
Prints the citizens in a specified sector.
| sectorID | The identifier of the sector whose citizens will be printed. |
| void CityGrowth::setRoads | ( | RoadSystemAdapter * | rs | ) |
Sets the road system for the city.
| rs | A pointer to a RoadSystemAdapter object representing the road system. |