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

Class representing a school, a specific type of institutional building. More...

#include <Buildings.h>

Inheritance diagram for School:
Instatutional Building

Public Member Functions

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

The School class inherits from Instatutional and represents an educational institution with multiple floors.

Constructor & Destructor Documentation

◆ School()

School::School ( std::string name,
int numRooms,
int m_squared,
float value,
int capacity,
int numfloors )

Constructor for the School class.

Parameters
nameName of the school.
numRoomsNumber of rooms in the school.
m_squaredArea of the school in square meters.
valueValue of the school.
capacityMaximum capacity of the school.
numfloorsNumber of floors in the school.

Member Function Documentation

◆ build()

void School::build ( )
overridevirtual

Builds the school.

Implements Instatutional.

◆ clone()

School * School::clone ( )
overridevirtual

Clones the School object.

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

Implements Instatutional.

◆ getType()

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

Gets the type of the building (School).

Returns
A string indicating the type of the building.

Implements Instatutional.