Package model.common
Class Budget
java.lang.Object
model.common.Budget
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBalance
(double amount, Date now) void
addMaintenanceFee
(double maintenanceFee) void
deductMaintenanceFee
(double maintenanceFee) double
int
getNegativeYears
(Date now) Gets the number of years since the last day the budget is positive.double
getRevenue
(GameModel gm) Gets the revenue of the citydouble
Gets the spend of the citydouble
double
void
setTaxRate
(double taxRate)
-
Constructor Details
-
Budget
public Budget(double balance, double taxRate)
-
-
Method Details
-
getBalance
public double getBalance() -
getTaxRate
public double getTaxRate() -
getTotalMaintenanceFee
public double getTotalMaintenanceFee() -
setTaxRate
public void setTaxRate(double taxRate) -
addBalance
-
getNegativeYears
Gets the number of years since the last day the budget is positive.- Parameters:
now
- current date- Returns:
- number of years
-
addMaintenanceFee
public void addMaintenanceFee(double maintenanceFee) -
deductMaintenanceFee
public void deductMaintenanceFee(double maintenanceFee) -
getRevenue
Gets the revenue of the city- Parameters:
gm
- game model- Returns:
- amount
-
getSpend
Gets the spend of the city- Parameters:
gm
- game model- Returns:
- amount
-