Abstract class representing a power plant. More...
#include <Utilities.h>
Public Member Functions | |
| PowerPlant (powerPlants type, bool isbuilt, int powerGen=0) | |
| Constructs a PowerPlant object. | |
| ~PowerPlant () | |
| Destructor for PowerPlant. | |
| virtual PowerPlant * | repair ()=0 |
| Repairs the power plant. | |
| virtual PowerPlant * | mulfunction ()=0 |
| Indicates a malfunction in the power plant. | |
| int | getPowerGeneration () |
| Gets the effective power generation. | |
| powerPlants | getType () |
| Gets the type of power plant. | |
| void | generate () |
| Generates power. | |
| int | getPowerGenerationRaw () const |
| Gets the raw power generation value. | |
| powerPlants | getType () const |
| Gets the type of power plant. | |
| void | setPowerGeneration (int value) |
| Sets the power generation capacity. | |
| void | setType (powerPlants value) |
| Sets the type of power plant. | |
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 | powerGeneration |
| Power generation capacity in watts. | |
| powerPlants | type |
| Type of power plant. | |
| Energy * | energy |
| Pointer to energy 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 power plant.
This class includes attributes for power generation and type of power plant.
| PowerPlant::PowerPlant | ( | powerPlants | type, |
| bool | isbuilt, | ||
| int | powerGen = 0 ) |
Constructs a PowerPlant object.
| type | The type of power plant. |
| isbuilt | Indicates if the power plant is built. |
| powerGen | Initial power generation capacity. |
| int PowerPlant::getPowerGeneration | ( | ) |
Gets the effective power generation.
|
inline |
Gets the raw power generation value.
| powerPlants PowerPlant::getType | ( | ) |
Gets the type of power plant.
|
inline |
Gets the type of power plant.
|
pure virtual |
Indicates a malfunction in the power plant.
Implemented in FunctionalPowerPlant, and NonFunctionalPowerPlant.
|
pure virtual |
Repairs the power plant.
Implemented in FunctionalPowerPlant, and NonFunctionalPowerPlant.
|
inline |
Sets the power generation capacity.
| value | Power generation value to set. |
|
inline |
Sets the type of power plant.
| value | The type of power plant to set. |