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

Class representing a non-functional power plant. More...

#include <Utilities.h>

Inheritance diagram for NonFunctionalPowerPlant:
PowerPlant Utility

Public Member Functions

 NonFunctionalPowerPlant (powerPlants type, bool built, int powerGen=0)
 Constructs a NonFunctionalPowerPlant object.
 
 ~NonFunctionalPowerPlant ()
 Destructor for NonFunctionalPowerPlant.
 
PowerPlantrepair () override
 Repairs the non-functional power plant.
 
PowerPlantmulfunction () override
 Indicates a malfunction in the non-functional power plant.
 
- Public Member Functions inherited from PowerPlant
 PowerPlant (powerPlants type, bool isbuilt, int powerGen=0)
 Constructs a PowerPlant object.
 
 ~PowerPlant ()
 Destructor for PowerPlant.
 
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.
 

Additional Inherited Members

- Protected Attributes inherited from PowerPlant
int powerGeneration
 Power generation capacity in watts.
 
powerPlants type
 Type of power plant.
 
Energyenergy
 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).
 
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

Class representing a non-functional power plant.

Constructor & Destructor Documentation

◆ NonFunctionalPowerPlant()

NonFunctionalPowerPlant::NonFunctionalPowerPlant ( powerPlants type,
bool built,
int powerGen = 0 )

Constructs a NonFunctionalPowerPlant object.

Parameters
typeThe type of power plant.
builtIndicates if the power plant is built.
powerGenInitial power generation capacity.

Member Function Documentation

◆ mulfunction()

PowerPlant * NonFunctionalPowerPlant::mulfunction ( )
overridevirtual

Indicates a malfunction in the non-functional power plant.

Returns
Pointer to the malfunctioning PowerPlant.

Implements PowerPlant.

◆ repair()

PowerPlant * NonFunctionalPowerPlant::repair ( )
overridevirtual

Repairs the non-functional power plant.

Returns
Pointer to the repaired PowerPlant.

Implements PowerPlant.