* Get the number of vehicles above profit minimum age in the group with GroupID * id_g and its sub-groups. * @param company The company the group belongs to * @param id_g The GroupID of the group used * @param type The vehicle type of the group * @return The number of vehicles above profit minimum age in the group */
| 859 | * @return The number of vehicles above profit minimum age in the group |
| 860 | */ |
| 861 | uint GetGroupNumVehicleMinAge(CompanyID company, GroupID id_g, VehicleType type) |
| 862 | { |
| 863 | uint count = 0; |
| 864 | |
| 865 | if (const Group *g = Group::GetIfValid(id_g); g != nullptr) { |
| 866 | for (const GroupID &childgroup : g->children) { |
| 867 | count += GetGroupNumVehicleMinAge(company, childgroup, type); |
| 868 | } |
| 869 | } |
| 870 | |
| 871 | return count + GroupStatistics::Get(company, id_g, type).num_vehicle_min_age; |
| 872 | } |
| 873 | |
| 874 | /** |
| 875 | * Get last year's profit of vehicles above minimum age |
no outgoing calls
no test coverage detected