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

Class representing an office, a specific type of commercial building. More...

#include <Buildings.h>

Inheritance diagram for Office:
Commercial Building

Public Member Functions

 Office (std::string name, int numRooms, int m_squared, float value, int capacity, int numFloors, int offices)
 Constructor for the Office class.
 
void build () override
 Builds the office building.
 
Officeclone () override
 Clones the Office object.
 
std::string getType () const override
 Gets the type of the building (Office).
 
- Public Member Functions inherited from Commercial
 Commercial (std::string name, int numRooms, int m_squared, float value, int capacity, int numFloors, std::string type)
 Constructor for a Commercial building.
 
void addCitizen (Citizen *human) override
 Adds a citizen to the commercial building.
 
void displayCitizens () override
 Displays the list of citizens in the commercial building.
 
int getLeftOverCapacity () override
 Gets the remaining capacity of the commercial 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 Commercial
int capacity
 Maximum occupancy capacity of the commercial building.
 
int numFloors
 Number of floors in the commercial 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 an office, a specific type of commercial building.

The Office class inherits from Commercial and includes attributes specific to offices, such as the number of offices.

Constructor & Destructor Documentation

◆ Office()

Office::Office ( std::string name,
int numRooms,
int m_squared,
float value,
int capacity,
int numFloors,
int offices )

Constructor for the Office class.

Parameters
nameName of the office building.
numRoomsNumber of rooms in the office building.
m_squaredArea of the office building in square meters.
valueValue of the office building.
capacityMaximum capacity of the office building.
numFloorsNumber of floors in the office building.
officesNumber of individual office spaces in the building.

Member Function Documentation

◆ build()

void Office::build ( )
overridevirtual

Builds the office building.

Implements Commercial.

◆ clone()

Office * Office::clone ( )
overridevirtual

Clones the Office object.

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

Implements Commercial.

◆ getType()

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

Gets the type of the building (Office).

Returns
A string indicating the type of the building.

Implements Commercial.