Abstract class representing a water supply system. More...
#include <Utilities.h>
Public Member Functions | |
| WaterSupply (bool built, int powerGen=0) | |
| Constructs a WaterSupply object. | |
| ~WaterSupply () | |
| Destructor for WaterSupply. | |
| virtual WaterSupply * | repair ()=0 |
| Repairs the water supply system. | |
| virtual WaterSupply * | mulfunction ()=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. | |
| Water * | water |
| 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). | |
| Budget * | budget |
| Pointer to the budget for the utility. | |
| Concrete * | concrete |
| Pointer to concrete resources. | |
| Steel * | steel |
| Pointer to steel resources. | |
| Wood * | wood |
| Pointer to wood resources. | |
| bool | isFunctional |
| Indicates whether the utility is functional. | |
Abstract class representing a water supply system.
This class manages attributes related to water generation.
| WaterSupply::WaterSupply | ( | bool | built, |
| int | powerGen = 0 ) |
Constructs a WaterSupply object.
| built | Indicates if the water supply system is built. |
| powerGen | Initial water generation capacity. |
| int WaterSupply::getWaterGeneration | ( | ) |
Gets the water generation capacity.
|
inline |
Gets the raw water generation value.
|
pure virtual |
Indicates a malfunction in the water supply system.
Implemented in FunctionalWaterSupply, and NonFunctionalWaterSupply.
|
pure virtual |
Repairs the water supply system.
Implemented in FunctionalWaterSupply, and NonFunctionalWaterSupply.
|
inline |
Sets the water generation capacity.
| value | Water generation value to set. |