sudo apt-get marks
 
Loading...
Searching...
No Matches
House Class Reference

Class representing a house, a specific type of residential building. More...

#include <Buildings.h>

Inheritance diagram for House:
Residential Building

Public Member Functions

 House (std::string name, int numRooms, int m_squared, float value, int numBedrooms, int numBathrooms, int capacity, int kitchenSize)
 Constructor for the House class.
 
void build () override
 Builds the house.
 
Houseclone () override
 Clones the House object.
 
std::string getType () const override
 Gets the type of the building (House).
 
- Public Member Functions inherited from Residential
 Residential (std::string name, int numRooms, int m_squared, float value, int numBedrooms, int numBathrooms, int capacity, std::string type)
 Constructor for a Residential building.
 
void addCitizen (Citizen *human) override
 Adds a citizen to the residential building.
 
void displayCitizens () override
 Displays the list of citizens in the residential building.
 
int getLeftOverCapacity () override
 Gets the remaining capacity of the residential building.
 
int getCapacity ()
 Gets the maximum capacity of the residential building.
 
std::vector< Citizen * > getCitizens ()
 Gets the list of citizens in the residential 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.
 

Additional Inherited Members

- Protected Attributes inherited from Residential
int numBedrooms
 Number of bedrooms in the residential building.
 
int numBathrooms
 Number of bathrooms in the residential building.
 
int capacity
 Maximum occupancy capacity of the 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

Class representing a house, a specific type of residential building.

The House class inherits from Residential and includes attributes specific to houses, such as kitchen size.

Constructor & Destructor Documentation

◆ House()

House::House ( std::string name,
int numRooms,
int m_squared,
float value,
int numBedrooms,
int numBathrooms,
int capacity,
int kitchenSize )

Constructor for the House class.

Parameters
nameName of the house.
numRoomsNumber of rooms in the house.
m_squaredArea of the house in square meters.
valueValue of the house.
numBedroomsNumber of bedrooms in the house.
numBathroomsNumber of bathrooms in the house.
capacityMaximum capacity of the house.
kitchenSizeSize of the kitchen in the house.

Member Function Documentation

◆ build()

void House::build ( )
overridevirtual

Builds the house.

Implements Residential.

◆ clone()

House * House::clone ( )
overridevirtual

Clones the House object.

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

Implements Residential.

◆ getType()

std::string House::getType ( ) const
inlineoverridevirtual

Gets the type of the building (House).

Returns
A string indicating the type of the building.

Implements Residential.