Singleton class representing energy resources in the city. More...
#include <Resources.h>
Public Member Functions | |
| Energy (const Energy &)=delete | |
| void | operator= (const Energy &)=delete |
| int | getWattsCoal () const |
| Gets the amount of energy generated from coal. | |
| int | getWattsHydro () const |
| Gets the amount of energy generated from hydro. | |
| int | getWattsWind () const |
| Gets the amount of energy generated from wind. | |
| int | getWattsSolar () const |
| Gets the amount of energy generated from solar. | |
| int | getTotalWatts () const |
| Gets the total amount of energy generated. | |
| void | setWattsCoal (int value) |
| Sets the amount of energy generated from coal. | |
| void | setWattsHydro (int value) |
| Sets the amount of energy generated from hydro. | |
| void | setWattsWind (int value) |
| Sets the amount of energy generated from wind. | |
| void | setWattsSolar (int value) |
| Sets the amount of energy generated from solar. | |
| void | setTotalWatts (int value) |
| Sets the total amount of energy generated. | |
Public Member Functions inherited from Resources | |
| Resources () | |
| Default constructor for Resources. | |
Static Public Member Functions | |
| static Energy * | getInstance () |
| Gets the singleton instance of the Energy class. | |
Singleton class representing energy resources in the city.
The Energy class manages different types of energy sources such as coal, hydro, wind, and solar. It provides access to their wattage values and follows the Singleton design pattern to ensure that only one instance of this class exists throughout the application.
|
static |
|
inline |
Gets the total amount of energy generated.
|
inline |
Gets the amount of energy generated from coal.
|
inline |
Gets the amount of energy generated from hydro.
|
inline |
Gets the amount of energy generated from solar.
|
inline |
Gets the amount of energy generated from wind.
|
inline |
Sets the total amount of energy generated.
| value | The total energy to set (in watts). |
|
inline |
Sets the amount of energy generated from coal.
| value | The amount of energy to set (in watts). |
|
inline |
Sets the amount of energy generated from hydro.
| value | The amount of energy to set (in watts). |
|
inline |
Sets the amount of energy generated from solar.
| value | The amount of energy to set (in watts). |
|
inline |
Sets the amount of energy generated from wind.
| value | The amount of energy to set (in watts). |