Add: Industry accepted and waiting history graphs.
Records amount of cargo accepted, and a rolling average of the waiting amount. Average waiting samples the waiting amount once per day for each industry, spread out over an economy day.
This commit is contained in:
committed by
Peter Nelson
parent
5eeda026a4
commit
56942a15c7
@@ -37,6 +37,7 @@ TimerGameEconomy::Year TimerGameEconomy::year = {};
|
||||
TimerGameEconomy::Month TimerGameEconomy::month = {};
|
||||
TimerGameEconomy::Date TimerGameEconomy::date = {};
|
||||
TimerGameEconomy::DateFract TimerGameEconomy::date_fract = {};
|
||||
uint TimerGameEconomy::days_since_last_month = {};
|
||||
|
||||
/**
|
||||
* Converts a Date to a Year, Month & Day.
|
||||
@@ -133,6 +134,7 @@ bool TimerManager<TimerGameEconomy>::Elapsed([[maybe_unused]] TimerGameEconomy::
|
||||
|
||||
/* increase day counter */
|
||||
TimerGameEconomy::date++;
|
||||
++TimerGameEconomy::days_since_last_month;
|
||||
|
||||
TimerGameEconomy::YearMonthDay ymd = TimerGameEconomy::ConvertDateToYMD(TimerGameEconomy::date);
|
||||
|
||||
@@ -177,6 +179,8 @@ bool TimerManager<TimerGameEconomy>::Elapsed([[maybe_unused]] TimerGameEconomy::
|
||||
}
|
||||
}
|
||||
|
||||
if (new_month) TimerGameEconomy::days_since_last_month = 0;
|
||||
|
||||
/* check if we reached the maximum year, decrement dates by a year */
|
||||
if (TimerGameEconomy::year == EconomyTime::MAX_YEAR + 1) {
|
||||
TimerGameEconomy::year--;
|
||||
|
||||
Reference in New Issue
Block a user