Codechange: Using alias and std::array for company expense storage. (#11273)

This simplifies passing yearly expenses to functions and use of std algorithms.
This commit is contained in:
PeterN
2023-09-09 14:15:53 +01:00
committed by GitHub
parent 00f13282a9
commit afc1ea8135
5 changed files with 12 additions and 9 deletions

View File

@@ -92,7 +92,7 @@ struct CompanyProperties {
*/
bool is_ai;
Money yearly_expenses[3][EXPENSES_END]; ///< Expenses of the company for the last three years, in every #ExpensesType category.
std::array<Expenses, 3> yearly_expenses{}; ///< Expenses of the company for the last three years.
CompanyEconomyEntry cur_economy; ///< Economic data of the company of this quarter.
CompanyEconomyEntry old_economy[MAX_HISTORY_QUARTERS]; ///< Economic data of the company of the last #MAX_HISTORY_QUARTERS quarters.
byte num_valid_stat_ent; ///< Number of valid statistical entries in #old_economy.