sudo apt-get marks
 
Loading...
Searching...
No Matches
Industrial Class Referenceabstract

Abstract class representing an industrial building. More...

#include <Buildings.h>

Inheritance diagram for Industrial:
Building Factory Plant Warehouse

Public Member Functions

 Industrial (std::string name, int numRooms, int m_squared, float value, int carbonFootprint, int capacity, std::string type)
 Constructor for an Industrial building.
 
virtual void build ()=0
 Pure virtual function to build the industrial building.
 
virtual Industrialclone ()=0
 Pure virtual function to clone the industrial building.
 
void addCitizen (Citizen *human) override
 Adds a citizen to the industrial building.
 
void displayCitizens () override
 Displays the list of citizens in the industrial building.
 
int getLeftOverCapacity () override
 Gets the remaining capacity of the industrial building.
 
virtual std::string getType () const =0
 Pure virtual function to get the type of the industrial building.
 
- Public Member Functions inherited from Building
 Building (std::string name, int numRooms, int m_squared, float value, std::string type)
 Constructor to initialize a Building object.
 
virtual ~Building ()
 Virtual destructor for the Building class.
 
std::vector< Citizen * > getCitizens () const
 Gets the list of citizens in the building.
 
std::string getName ()
 Gets the name of the building.
 
std::string getBuildingType ()
 Gets the building's type description.
 
bool getBuilt () const
 Checks if the building is built.
 
void renovate ()
 Renovates the building, updating any necessary properties.
 

Protected Attributes

int carbonFootprint
 The carbon footprint of the industrial building.
 
int capacity
 Maximum occupancy capacity of the industrial building.
 
- Protected Attributes inherited from Building
std::string name
 Name of the building.
 
std::string type
 Type of the building (e.g., Residential, Commercial)
 
int numRooms
 Number of rooms in the building.
 
int m_squared
 Area of the building in square meters.
 
float value
 Value of the building.
 
bool built = false
 Flag indicating if the building is built.
 
Budgetbudget
 Pointer to a Budget object for managing building finances.
 
Concreteconcrete
 Pointer to a Concrete object for building materials.
 
Steelsteel
 Pointer to a Steel object for building materials.
 
Woodwood
 Pointer to a Wood object for building materials.
 
std::vector< Citizen * > citizens
 List of citizens associated with the building.
 

Detailed Description

Abstract class representing an industrial building.

The Industrial class is derived from the Building class and serves as a base class for various types of industrial buildings. It includes attributes specific to industrial buildings, such as carbon footprint and capacity.

Constructor & Destructor Documentation

◆ Industrial()

Industrial::Industrial ( std::string name,
int numRooms,
int m_squared,
float value,
int carbonFootprint,
int capacity,
std::string type )

Constructor for an Industrial building.

Parameters
nameName of the building.
numRoomsNumber of rooms in the building.
m_squaredArea of the building in square meters.
valueValue of the building.
carbonFootprintThe carbon footprint of the building.
capacityMaximum capacity of the building.
typeType of the building.

Member Function Documentation

◆ addCitizen()

void Industrial::addCitizen ( Citizen * human)
overridevirtual

Adds a citizen to the industrial building.

Parameters
humanPointer to the Citizen to be added.

Implements Building.

◆ build()

virtual void Industrial::build ( )
pure virtual

Pure virtual function to build the industrial building.

Implements Building.

Implemented in Factory, Plant, and Warehouse.

◆ clone()

virtual Industrial * Industrial::clone ( )
pure virtual

Pure virtual function to clone the industrial building.

Returns
A pointer to a new Industrial object that is a clone of the current instance.

Implements Building.

Implemented in Factory, Plant, and Warehouse.

◆ displayCitizens()

void Industrial::displayCitizens ( )
overridevirtual

Displays the list of citizens in the industrial building.

Reimplemented from Building.

◆ getLeftOverCapacity()

int Industrial::getLeftOverCapacity ( )
overridevirtual

Gets the remaining capacity of the industrial building.

Returns
The number of additional citizens the building can accommodate.

Implements Building.

◆ getType()

virtual std::string Industrial::getType ( ) const
pure virtual

Pure virtual function to get the type of the industrial building.

Returns
The type of the building as a string.

Implements Building.

Implemented in Factory, Plant, and Warehouse.