OpenTTD Source 20260421-master-gc2fbc6fdeb
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
9
10static const EnumClassIndexContainer<std::array<PriceBaseSpec, to_underlying(Price::End)>, Price> _price_base_specs = {
11 PriceBaseSpec(100, PCAT_NONE, GrfSpecFeature::End, Price::Invalid), // Price::StationValue
16 PriceBaseSpec(600, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildDepotTrain
20 PriceBaseSpec(200, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildStationRail
21 PriceBaseSpec(180, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildStationRailLength
22 PriceBaseSpec(600, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildStationAirport
23 PriceBaseSpec(200, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildStationBus
24 PriceBaseSpec(200, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildStationTruck
25 PriceBaseSpec(350, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildStationDock
26 PriceBaseSpec(400000, PCAT_CONSTRUCTION, GrfSpecFeature::Trains, Price::Invalid), // Price::BuildVehicleTrain
27 PriceBaseSpec(2000, PCAT_CONSTRUCTION, GrfSpecFeature::Trains, Price::Invalid), // Price::BuildVehicleWagon
28 PriceBaseSpec(700000, PCAT_CONSTRUCTION, GrfSpecFeature::Aircraft, Price::Invalid), // Price::BuildVehicleAircraft
30 PriceBaseSpec(65000, PCAT_CONSTRUCTION, GrfSpecFeature::Ships, Price::Invalid), // Price::BuildVehicleShip
46 PriceBaseSpec(50, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::ClearStationRail
47 PriceBaseSpec(30, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::ClearStationAirport
49 PriceBaseSpec(50, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::ClearStationTruck
50 PriceBaseSpec(55, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::ClearStationDock
53 PriceBaseSpec(5600, PCAT_RUNNING, GrfSpecFeature::Trains, Price::Invalid), // Price::RunningTrainSteam
54 PriceBaseSpec(5200, PCAT_RUNNING, GrfSpecFeature::Trains, Price::Invalid), // Price::RunningTrainDiesel
55 PriceBaseSpec(4800, PCAT_RUNNING, GrfSpecFeature::Trains, Price::Invalid), // Price::RunningTrainElectric
56 PriceBaseSpec(9600, PCAT_RUNNING, GrfSpecFeature::Aircraft, Price::Invalid), // Price::RunningAircraft
59 PriceBaseSpec(1000000, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::Invalid), // Price::BuildIndustry
69 PriceBaseSpec(8000000, PCAT_CONSTRUCTION, GrfSpecFeature::End, Price::BuildIndustry), // Price::BuildIndustryRaw
77 PriceBaseSpec(10, PCAT_RUNNING, GrfSpecFeature::End, Price::BuildRail), // Price::InfrastructureRail
78 PriceBaseSpec(10, PCAT_RUNNING, GrfSpecFeature::End, Price::BuildRoad), // Price::InfrastructureRoad
79 PriceBaseSpec(8, PCAT_RUNNING, GrfSpecFeature::End, Price::BuildCanal), // Price::InfrastructureWater
80 PriceBaseSpec(100, PCAT_RUNNING, GrfSpecFeature::End, Price::StationValue), // Price::InfrastructureStation
81 PriceBaseSpec(5000, PCAT_RUNNING, GrfSpecFeature::End, Price::BuildStationAirport), // Price::InfrastructureAirport
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:21
@ Trains
Trains feature.
Definition newgrf.h:73
@ RoadVehicles
Road vehicles feature.
Definition newgrf.h:74
@ Ships
Ships feature.
Definition newgrf.h:75
@ End
End marker.
Definition newgrf.h:95
@ Aircraft
Aircraft feature.
Definition newgrf.h:76
@ Objects
Objects feature.
Definition newgrf.h:88
Describes properties of price bases.
Definition newgrf.h:209