OpenTTD Source 20260129-master-g2bb01bd0e4
pricebase.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10static const EnumClassIndexContainer<std::array<PriceBaseSpec, to_underlying(Price::End)>, Price> _price_base_specs = {
11 PriceBaseSpec(100, PCAT_NONE, GSF_END, Price::Invalid),
26 PriceBaseSpec(400000, PCAT_CONSTRUCTION, GSF_TRAINS, Price::Invalid),
28 PriceBaseSpec(700000, PCAT_CONSTRUCTION, GSF_AIRCRAFT, Price::Invalid),
29 PriceBaseSpec(14000, PCAT_CONSTRUCTION, GSF_ROADVEHICLES, Price::Invalid),
53 PriceBaseSpec(5600, PCAT_RUNNING, GSF_TRAINS, Price::Invalid),
54 PriceBaseSpec(5200, PCAT_RUNNING, GSF_TRAINS, Price::Invalid),
55 PriceBaseSpec(4800, PCAT_RUNNING, GSF_TRAINS, Price::Invalid),
56 PriceBaseSpec(9600, PCAT_RUNNING, GSF_AIRCRAFT, Price::Invalid),
57 PriceBaseSpec(1600, PCAT_RUNNING, GSF_ROADVEHICLES, Price::Invalid),
58 PriceBaseSpec(5600, PCAT_RUNNING, GSF_SHIPS, Price::Invalid),
82};
A sort-of mixin that implements 'at(pos)' and 'operator[](pos)' only for a specific enum class.
@ PCAT_RUNNING
Price is affected by "vehicle running cost" difficulty setting.
@ PCAT_CONSTRUCTION
Price is affected by "construction cost" difficulty setting.
@ PCAT_NONE
Not affected by difficulty settings.
Price
Enumeration of all base prices for use with Prices.
@ ClearStationTruck
Price for destroying lorry stations.
@ BuildStationAirport
Price for building airports.
@ ClearRough
Price for destroying rough land.
@ Terraform
Price for terraforming land, e.g. rising, lowering and flattening.
@ Invalid
Invalid base price.
@ BuildIndustry
Price for funding new industries.
@ BuildCanal
Price for building new canals.
@ ClearWater
Price for destroying water e.g. see, rives.
@ End
Price base end marker.
@ StationValue
Stations value and additional constant company running fee.
@ ClearHouse
Price for destroying houses and other town buildings.
@ BuildStationDock
Price for building docks.
@ BuildRail
Price for building rails.
@ ClearDepotTrain
Price for destroying train depots.
@ BuildRoad
Price for building roads.
@ BuildDepotTrain
Price for building train depots.
@ ClearBridge
Price for destroying bridges.
constexpr std::underlying_type_t< enum_type > to_underlying(enum_type e)
Implementation of std::to_underlying (from C++23)
Definition enum_type.hpp:17
Describes properties of price bases.
Definition newgrf.h:199