Merge branch 'master' into jgrpp

# Conflicts:
#	src/group_cmd.cpp
#	src/lang/korean.txt
#	src/lang/simplified_chinese.txt
#	src/script/api/script_rail.cpp
#	src/tunnelbridge_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2023-01-23 19:10:07 +00:00
79 changed files with 181 additions and 237 deletions

View File

@@ -23,15 +23,14 @@ extern GroupPool _group_pool; ///< Pool of groups.
/** Statistics and caches on the vehicles in a group. */
struct GroupStatistics {
uint16 num_vehicle; ///< Number of vehicles.
Money profit_last_year; ///< Sum of profits for all vehicles.
Money profit_last_year_min_age; ///< Sum of profits for vehicles considered for profit statistics.
uint16 *num_engines; ///< Caches the number of engines of each type the company owns.
uint16 num_vehicle; ///< Number of vehicles.
uint16 num_vehicle_min_age; ///< Number of vehicles considered for profit statistics;
bool autoreplace_defined; ///< Are any autoreplace rules set?
bool autoreplace_finished; ///< Have all autoreplacement finished?
uint16 num_profit_vehicle; ///< Number of vehicles considered for profit statistics;
Money profit_last_year; ///< Sum of profits for all vehicles.
GroupStatistics();
~GroupStatistics();
@@ -39,8 +38,10 @@ struct GroupStatistics {
void ClearProfits()
{
this->num_profit_vehicle = 0;
this->profit_last_year = 0;
this->num_vehicle_min_age = 0;
this->profit_last_year_min_age = 0;
}
void ClearAutoreplace()
@@ -55,7 +56,8 @@ struct GroupStatistics {
static void CountVehicle(const Vehicle *v, int delta);
static void CountEngine(const Vehicle *v, int delta);
static void VehicleReachedProfitAge(const Vehicle *v);
static void AddProfitLastYear(const Vehicle *v);
static void VehicleReachedMinAge(const Vehicle *v);
static void UpdateProfits();
static void UpdateAfterLoad();
@@ -108,8 +110,8 @@ static inline bool IsTopLevelGroupID(GroupID index)
uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e);
uint GetGroupNumVehicle(CompanyID company, GroupID id_g, VehicleType type);
uint GetGroupNumProfitVehicle(CompanyID company, GroupID id_g, VehicleType type);
Money GetGroupProfitLastYear(CompanyID company, GroupID id_g, VehicleType type);
uint GetGroupNumVehicleMinAge(CompanyID company, GroupID id_g, VehicleType type);
Money GetGroupProfitLastYearMinAge(CompanyID company, GroupID id_g, VehicleType type);
void SetTrainGroupID(Train *v, GroupID grp);
void UpdateTrainGroupID(Train *v);