* Calculates the maintenance cost of all airports of a company. * @param owner Company. * @return Total cost. */
| 711 | * @return Total cost. |
| 712 | */ |
| 713 | Money AirportMaintenanceCost(Owner owner) |
| 714 | { |
| 715 | Money total_cost = 0; |
| 716 | |
| 717 | for (const Station *st : Station::Iterate()) { |
| 718 | if (st->owner == owner && st->facilities.Test(StationFacility::Airport)) { |
| 719 | total_cost += _price[PR_INFRASTRUCTURE_AIRPORT] * st->airport.GetSpec()->maintenance_cost; |
| 720 | } |
| 721 | } |
| 722 | /* 3 bits fraction for the maintenance cost factor. */ |
| 723 | return total_cost >> 3; |
| 724 | } |
| 725 | |
| 726 | bool StationCompare::operator() (const Station *lhs, const Station *rhs) const |
| 727 | { |
no test coverage detected