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

Abstract class representing a water supply system. More...

#include <Utilities.h>

Inheritance diagram for WaterSupply:
Utility FunctionalWaterSupply NonFunctionalWaterSupply

Public Member Functions

 WaterSupply (bool built, int powerGen=0)
 Constructs a WaterSupply object.
 
 ~WaterSupply ()
 Destructor for WaterSupply.
 
virtual WaterSupplyrepair ()=0
 Repairs the water supply system.
 
virtual WaterSupplymulfunction ()=0
 Indicates a malfunction in the water supply system.
 
int getWaterGeneration ()
 Gets the water generation capacity.
 
void distribute ()
 Distributes water from the supply.
 
int getWaterGenerationRaw () const
 Gets the raw water generation value.
 
void setWaterGeneration (int value)
 Sets the water generation capacity.
 
- Public Member Functions inherited from Utility
 Utility ()
 Constructor for Utility.
 
 ~Utility ()
 Destructor for Utility.
 
float getEfficiency () const
 Gets the efficiency of the utility.
 
void setEfficiency (float value)
 Sets the efficiency of the utility.
 
bool getFunctional () const
 Checks if the utility is functional.
 
void setFunctional (bool value)
 Sets the functional status of the utility.
 

Protected Attributes

int waterGeneration
 Water generation capacity in liters.
 
Waterwater
 Pointer to water resources.
 
bool isInitialBuild = false
 Indicates if it is an initial build.
 
- Protected Attributes inherited from Utility
float efficiency
 Efficiency of the utility service (percentage).
 
Budgetbudget
 Pointer to the budget for the utility.
 
Concreteconcrete
 Pointer to concrete resources.
 
Steelsteel
 Pointer to steel resources.
 
Woodwood
 Pointer to wood resources.
 
bool isFunctional
 Indicates whether the utility is functional.
 

Detailed Description

Abstract class representing a water supply system.

This class manages attributes related to water generation.

Constructor & Destructor Documentation

◆ WaterSupply()

WaterSupply::WaterSupply ( bool built,
int powerGen = 0 )

Constructs a WaterSupply object.

Parameters
builtIndicates if the water supply system is built.
powerGenInitial water generation capacity.

Member Function Documentation

◆ getWaterGeneration()

int WaterSupply::getWaterGeneration ( )

Gets the water generation capacity.

Returns
Water generation in liters.

◆ getWaterGenerationRaw()

int WaterSupply::getWaterGenerationRaw ( ) const
inline

Gets the raw water generation value.

Returns
The raw water generation capacity.

◆ mulfunction()

virtual WaterSupply * WaterSupply::mulfunction ( )
pure virtual

Indicates a malfunction in the water supply system.

Returns
Pointer to the malfunctioning WaterSupply.

Implemented in FunctionalWaterSupply, and NonFunctionalWaterSupply.

◆ repair()

virtual WaterSupply * WaterSupply::repair ( )
pure virtual

Repairs the water supply system.

Returns
Pointer to the repaired WaterSupply.

Implemented in FunctionalWaterSupply, and NonFunctionalWaterSupply.

◆ setWaterGeneration()

void WaterSupply::setWaterGeneration ( int value)
inline

Sets the water generation capacity.

Parameters
valueWater generation value to set.