Singleton class representing the financial budget of the city. More...
#include <Resources.h>
Public Member Functions | |
| Budget (const Budget &)=delete | |
| void | operator= (const Budget &)=delete |
| double | getCash () const |
| Gets the current amount of cash in the budget. | |
| double | getDebt () const |
| Gets the total amount of debt incurred by the city. | |
| void | setCash (double cash) |
| Sets the amount of cash in the budget. | |
| void | setDebt (double debt) |
| Sets the total amount of debt incurred by the city. | |
Public Member Functions inherited from Resources | |
| Resources () | |
| Default constructor for Resources. | |
Static Public Member Functions | |
| static Budget * | getInstance () |
| Gets the singleton instance of the Budget class. | |
Singleton class representing the financial budget of the city.
The Budget class manages the city's financial resources, including cash and debt. It follows the Singleton design pattern to ensure that only one instance of this class exists throughout the application.
|
inline |
Gets the current amount of cash in the budget.
|
inline |
Gets the total amount of debt incurred by the city.
|
static |
|
inline |
Sets the amount of cash in the budget.
| cash | The amount of cash to set. |
If the new cash amount is negative, this method will automatically set the debt to the absolute value of the cash amount.
|
inline |
Sets the total amount of debt incurred by the city.
| debt | The amount of debt to set. |