* Get the profit sprite ID to draw for the given group. * @param g_id Group to get profit sprite ID for. * @return SpriteID to draw. */
| 320 | * @return SpriteID to draw. |
| 321 | */ |
| 322 | SpriteID GetGroupProfitSpriteID(GroupID g_id) const |
| 323 | { |
| 324 | uint num_vehicle_min_age = GetGroupNumVehicleMinAge(this->vli.company, g_id, this->vli.vtype); |
| 325 | if (num_vehicle_min_age == 0) return SPR_PROFIT_NA; |
| 326 | |
| 327 | Money profit_last_year_min_age = GetGroupProfitLastYearMinAge(this->vli.company, g_id, this->vli.vtype); |
| 328 | if (profit_last_year_min_age < 0) return SPR_PROFIT_NEGATIVE; |
| 329 | if (profit_last_year_min_age < VEHICLE_PROFIT_THRESHOLD * num_vehicle_min_age) return SPR_PROFIT_SOME; |
| 330 | return SPR_PROFIT_LOT; |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * Draw a row in the group list. |
no test coverage detected