Go to the documentation of this file.
33 #include "table/strings.h"
54 lengthof(_orig_aircraft_vehicle_info),
79 this->list_position = base;
87 if (
type ==
VEH_ROAD) this->u.road.tractive_effort = 0x4C;
107 default: NOT_REACHED();
110 this->u.rail = _orig_rail_vehicle_info[base];
112 this->info.
string_id = STR_VEHICLE_NAME_TRAIN_ENGINE_RAIL_KIRBY_PAUL_TANK_STEAM + base;
120 this->u.road = _orig_road_vehicle_info[base];
122 this->info.
string_id = STR_VEHICLE_NAME_ROAD_VEHICLE_MPS_REGAL_BUS + base;
126 this->u.ship = _orig_ship_vehicle_info[base];
128 this->info.
string_id = STR_VEHICLE_NAME_SHIP_MPS_OIL_TANKER + base;
132 this->u.air = _orig_aircraft_vehicle_info[base];
134 this->info.
string_id = STR_VEHICLE_NAME_AIRCRAFT_SAMPSON_U52 + base;
161 return file ==
nullptr ? 0 : file->grfid;
176 switch (this->type) {
178 if (this->u.rail.capacity == 0)
return false;
182 if (this->u.road.capacity == 0)
return false;
189 default: NOT_REACHED();
205 if (mail_capacity !=
nullptr) *mail_capacity = 0;
219 (new_multipliers || default_cargo != cargo_type || (v !=
nullptr && v->
cargo_subtype != 0))) {
226 uint extra_mail_cap = 0;
227 switch (this->type) {
232 if (v ==
nullptr && this->u.rail.railveh_type ==
RAILVEH_MULTIHEAD) capacity += this->u.rail.capacity;
248 if (!new_multipliers && cargo_type == CT_MAIL)
return capacity + extra_mail_cap;
249 default_cargo = CT_PASSENGERS;
252 default: NOT_REACHED();
255 if (!new_multipliers) {
257 capacity += extra_mail_cap;
262 if (new_multipliers || (this->type !=
VEH_SHIP && default_cargo != cargo_type)) {
265 capacity *= cargo_multiplier;
266 if (extra_mail_cap > 0) {
268 capacity += (default_multiplier * extra_mail_cap * cargo_multiplier + mail_multiplier / 2) / mail_multiplier;
270 capacity = (capacity + default_multiplier / 2) / default_multiplier;
284 switch (this->type) {
286 base_price = this->u.road.running_cost_class;
287 if (base_price == INVALID_PRICE)
return 0;
292 base_price = this->u.rail.running_cost_class;
293 if (base_price == INVALID_PRICE)
return 0;
298 base_price = PR_RUNNING_SHIP;
303 base_price = PR_RUNNING_AIRCRAFT;
307 default: NOT_REACHED();
321 switch (this->type) {
323 base_price = PR_BUILD_VEHICLE_ROAD;
329 base_price = PR_BUILD_VEHICLE_WAGON;
332 base_price = PR_BUILD_VEHICLE_TRAIN;
338 base_price = PR_BUILD_VEHICLE_SHIP;
343 base_price = PR_BUILD_VEHICLE_AIRCRAFT;
347 default: NOT_REACHED();
359 switch (this->type) {
365 return (max_speed != 0) ? max_speed * 2 : this->u.road.max_speed / 2;
373 if (max_speed != 0) {
374 return (max_speed * 128) / 10;
376 return this->u.air.max_speed;
379 default: NOT_REACHED();
392 switch (this->type) {
398 default: NOT_REACHED();
410 switch (this->type) {
416 default: NOT_REACHED();
428 switch (this->type) {
434 default: NOT_REACHED();
454 switch (this->type) {
458 default: NOT_REACHED();
468 switch (this->type) {
470 switch (this->u.air.subtype) {
471 case AIR_HELI:
return STR_LIVERY_HELICOPTER;
472 case AIR_CTOL:
return STR_LIVERY_SMALL_PLANE;
473 case AIR_CTOL | AIR_FAST:
return STR_LIVERY_LARGE_PLANE;
474 default: NOT_REACHED();
477 default: NOT_REACHED();
488 for (uint internal_id = 0; internal_id <
_engine_counts[type]; internal_id++) {
491 eid.
grfid = INVALID_GRFID;
551 const Engine *e =
new Engine(eid.type, eid.internal_id);
553 assert(e->
index == index);
558 void ShowEnginePreviewWindow(
EngineID engine);
583 if (retire_early != 0 && age >= retire_early_max_age) {
590 if (age < e->duration_phase_1) {
797 int32 best_hist = -1;
800 c->old_economy[0].performance_history > best_hist) {
804 if (v->owner != c->index || v->type != e->
type)
continue;
805 if (!v->GetEngine()->CanCarryCargo() || !
HasBit(cargomask, v->cargo_type))
continue;
807 best_hist = c->old_economy[0].performance_history;
808 best_company = c->index;
832 default: NOT_REACHED();
850 if (!--e->preview_wait) {
858 e->preview_asked = (CompanyMask)-1;
862 SetBit(e->preview_asked, e->preview_company);
863 e->preview_wait = 20;
883 SB(e->company_hidden, cid, 1, 0);
946 bool allow =
HasBit(p2, 31);
974 uint block_preview = c->block_preview;
979 c->block_preview = 20;
984 if (v->owner == c->index && v->engine_type == index) {
986 c->block_preview = block_preview;
1044 if (!e->IsEnabled())
continue;
1057 if (
IsWagon(e->index))
continue;
1062 e->preview_asked = 0;
1078 if (!e->name.empty() && e->name == name)
return false;
1132 if (e ==
nullptr)
return false;
1135 if (e->
type != type)
return false;
1173 if (e ==
nullptr)
return false;
1178 if (ei->refit_mask == 0)
return false;
1186 CargoTypes default_cargo_mask = 0;
1187 SetBit(default_cargo_mask, default_cargo);
1188 return default_cargo !=
CT_INVALID && ei->refit_mask != default_cargo_mask;
1196 Date min_date = INT32_MAX;
1199 if (!e->IsEnabled())
continue;
1205 min_date = std::min(min_date, e->info.base_intro);
1208 if (min_date < INT32_MAX) {
@ VEH_AIRCRAFT
Aircraft vehicle type.
RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date)
Add the rail types that are to be introduced at the given date.
static const EngineID INVALID_ENGINE
Constant denoting an invalid engine.
Year base_life
Basic duration of engine availability (without random parts). 0xFF means infinite life.
static bool IsCompanyBuildableVehicleType(VehicleType type)
Is the given vehicle type buildable by a company?
UnitID max_aircraft
max planes in game per company
uint32 GetGRFID() const
Retrieve the GRF ID of the NewGRF the engine is tied to.
uint32 TileIndex
The index/ID of a Tile.
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data, bool gui_scope)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...
void CheckEngines()
Check for engines that have an appropriate availability.
@ PROP_TRAIN_SPEED
Max. speed: 1 unit = 1/1.6 mph = 1 km-ish/h.
uint32 generation_seed
noise seed for world generation
static bool ResetToCurrentNewGRFConfig()
Tries to reset the engine mapping to match the current NewGRF configuration.
@ NT_NEW_VEHICLES
New vehicle has become available.
static Titem * Get(size_t index)
Returns Titem with given index.
@ WC_BUILD_TOOLBAR
Build toolbar; Window numbers:
void ResetToDefaultMapping()
Initializes the EngineOverrideManager with the default engines.
@ PROP_TRAIN_CARGO_CAPACITY
Capacity (if dualheaded: for each single vehicle)
bool ai_disable_veh_roadveh
disable types for AI
@ PROP_ROADVEH_TRACTIVE_EFFORT
Tractive effort coefficient in 1/256.
void ReloadNewGRFData()
Reload all NewGRF files during a running game.
uint32 grfid
The GRF ID of the file the entity belongs to.
uint16 reliability_max
Maximal reliability of the engine.
Money GetPrice(Price index, uint cost_factor, const GRFFile *grf_file, int shift)
Determine a certain price.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
uint16 duration_phase_3
Third reliability phase in months, decaying to reliability_final.
@ PROP_ROADVEH_COST_FACTOR
Purchase cost.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
RailTypes avail_railtypes
Rail types available to this company.
@ WL_WARNING
Other information.
@ PROP_TRAIN_RUNNING_COST_FACTOR
Yearly runningcost (if dualheaded: sum of both vehicles)
byte landscape
the landscape we're currently in
uint16 reliability_spd_dec
Speed of reliability decay between services (per day).
RoadTypes introduces_roadtypes
Bitmask of which other roadtypes are introduced when this roadtype is introduced.
RoadTypes avail_roadtypes
Road types available to this company.
CommandCost CmdEngineCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Allow or forbid a specific company to use an engine.
const uint8 _engine_counts[4]
Number of engines of each vehicle type in original engine data.
static bool IsWagon(EngineID index)
Determine whether an engine type is a wagon (and not a loco).
static CompanyID GetPreviewCompany(Engine *e)
Get the best company for an engine preview.
Year _cur_year
Current year, starting at 0.
@ PROP_TRAIN_TRACTIVE_EFFORT
Tractive effort coefficient in 1/256.
void EnginesDailyLoop()
Daily check to offer an exclusive engine preview to the companies.
virtual void CleanPool()
Virtual method that deletes all items in the pool.
static Year _year_engine_aging_stops
Year that engine aging stops.
Price
Enumeration of all base prices for use with Prices.
@ PROP_AIRCRAFT_MAIL_CAPACITY
Mail Capacity.
CompanyMask company_avail
Bit for each company whether the engine is available for that company.
@ WC_ENGINE_PREVIEW
Engine preview window; Window numbers:
uint GetDisplayMaxTractiveEffort() const
Returns the tractive effort of the engine for display purposes.
@ VE_DEFAULT
Default value to indicate that visual effect should be based on engine class.
Stores the state of all random number generators.
Tindex index
Index of this pool item.
static CargoSpec * Get(size_t index)
Retrieve cargo details for the given cargo ID.
@ PROP_SHIP_CARGO_CAPACITY
Capacity.
uint16 duration_phase_1
First reliability phase in months, increasing reliability from reliability_start to reliability_max.
@ PROP_AIRCRAFT_RUNNING_COST_FACTOR
Yearly runningcost.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static void EnableEngineForCompany(EngineID eid, CompanyID company)
Allows engine eid to be used by a company company.
static void SaveRandomSeeds(SavedRandomSeeds *storage)
Saves the current seeds.
Money GetRunningCost() const
Return how much the running costs of this engine are.
static T ClrBit(T &x, const uint8 y)
Clears a bit in a variable.
uint16 reliability_start
Initial reliability of the engine.
StringID GetEngineCategoryName(EngineID engine)
Return the category of an engine.
int32 Year
Type for the year, note: 0 based, i.e. starts at the year 0.
@ ROADTYPE_END
Used for iterations.
void SetupEngines()
Initialise the engine pool with the data from the original vehicles.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, Date date)
Add the road types that are to be introduced at the given date.
CompanyID preview_company
Company which is currently being offered a preview INVALID_COMPANY means no company.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces)
Get the road types the given company can build.
void StartupOneEngine(Engine *e, Date aging_date)
Start/initialise one engine.
void DeleteWindowByClass(WindowClass cls)
Delete all windows of a given class.
Date GetLifeLengthInDays() const
Returns the vehicle's (not model's!) life length in days.
Information about a vehicle.
Date base_intro
Basic date of engine introduction (without random parts).
@ CBM_VEHICLE_CARGO_SUFFIX
Show suffix after cargo name.
#define MAX_DAY
The number of days till the last day.
@ VEH_ROAD
Road vehicle type.
@ CC_PASSENGERS
Passengers.
uint16 internal_id
The internal ID within the GRF file.
CargoID GetDefaultCargoType() const
Determines the default cargo type of an engine.
CompanyMask company_hidden
Bit for each company whether the engine is normally hidden in the build gui for that company.
RoadType roadtype
Road type.
void StartupEngines()
Start/initialise all our engines.
Owner
Enum for all companies/owners.
uint16 GetVehicleCallback(CallbackID callback, uint32 param1, uint32 param2, EngineID engine, const Vehicle *v)
Evaluate a newgrf callback for vehicles.
@ DC_EXEC
execute the given command
static void DisableEngineForCompany(EngineID eid, CompanyID company)
Forbids engine eid to be used by a company company.
EngineID GetID(VehicleType type, uint16 grf_local_id, uint32 grfid)
Looks up an EngineID in the EngineOverrideManager.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
DoCommandFlag
List of flags for a command.
CommandCost CmdRenameEngine(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Rename an engine.
static void RestoreRandomSeeds(const SavedRandomSeeds &storage)
Restores previously saved seeds.
void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x=0, int y=0, const GRFFile *textref_stack_grffile=nullptr, uint textref_stack_size=0, const uint32 *textref_stack=nullptr)
Display an error message in a window.
static uint CountBits(T value)
Counts the number of set bits in a variable.
byte extend_vehicle_life
extend vehicle life by this many years
GameCreationSettings game_creation
settings used during the creation of a game (map)
Year lifelength
Lifetime of a single vehicle.
const GRFFile * GetGRF() const
Retrieve the NewGRF the engine is tied to.
@ TRANSPORT_ROAD
Transport by road vehicle.
static const RailtypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
@ ENGINE_EXCLUSIVE_PREVIEW
This vehicle is in the exclusive preview stage, either being used or being offered to a company.
uint GetDisplayMaxSpeed() const
Returns max speed of the engine for display purposes.
size_t Utf8StringLength(const char *s)
Get the length of an UTF-8 encoded string in number of characters and thus not the number of bytes th...
@ PROP_ROADVEH_SPEED
Max. speed: 1 unit = 1/0.8 mph = 2 km-ish/h.
static bool IsVehicleTypeDisabled(VehicleType type, bool ai)
Checks if a vehicle type is disabled for all/ai companies.
uint16 EngineID
Unique identification number of an engine.
RoadTypes powered_roadtypes
bitmask to the OTHER roadtypes on which a vehicle of THIS roadtype generates power
#define return_cmd_error(errcode)
Returns from a function with a specific StringID as error.
bool ai_disable_veh_train
disable types for AI
static void NewEvent(CompanyID company, ScriptEvent *event)
Queue a new event for an AI.
Common return value for all commands.
Date _date
Current date in days (day counter)
CargoTypes GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type)
Ors the refit_masks of all articulated parts.
byte callback_mask
Bitmask of vehicle callbacks that have to be called.
UnitID max_ships
max ships in game per company
static const int CARGO_AGING_TICKS
cycle duration for aging cargo
EngineID engine_type
The type of engine used for this vehicle.
static T SB(T &x, const uint8 s, const uint8 n, const U d)
Set n bits in x starting at bit s to d.
Date ConvertYMDToDate(Year year, Month month, Day day)
Converts a tuple of Year, Month and Day to a Date.
static const int GROUND_ACCELERATION
Acceleration due to gravity, 9.8 m/s^2.
static const uint MAX_LENGTH_ENGINE_NAME_CHARS
The maximum length of an engine name in characters including '\0'.
int32 Date
The type to store our dates in.
CompanyMask preview_asked
Bit for each company which has already been offered a preview.
@ WC_REPLACE_VEHICLE
Replace vehicle window; Window numbers:
GameSettings _settings_game
Game settings of a running game or the scenario editor.
uint GetDisplayWeight() const
Returns the weight of the engine for display purposes.
void ConvertDateToYMD(Date date, YearMonthDay *ymd)
Converts a Date to a Year, Month & Day.
@ MAX_COMPANIES
Maximum number of companies.
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
static void BroadcastNewEvent(ScriptEvent *event, CompanyID skip_company=MAX_COMPANIES)
Broadcast a new event to all active AIs.
static bool IsInteractiveCompany(CompanyID company)
Is the user representing company?
static void CalcEngineReliability(Engine *e)
Update Engine::reliability and (if needed) update the engine GUIs.
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
void EnginesMonthlyLoop()
Monthly update of the availability, reliability, and preview offers of the engines.
int8 retire_early
Number of years early to retire vehicle.
static const int DAYS_IN_LEAP_YEAR
sometimes, you need one day more...
uint8 substitute_id
The (original) entity ID to use if this GRF is not available (currently not used)
Money GetCost() const
Return how much a new engine costs.
VehicleType
Available vehicle types.
@ PROP_AIRCRAFT_COST_FACTOR
Purchase cost.
@ ENGINE_AVAILABLE
This vehicle is available to everyone.
byte misc_flags
Miscellaneous flags.
@ PROP_SHIP_RUNNING_COST_FACTOR
Yearly runningcost.
@ RAILVEH_WAGON
simple wagon, not motorized
@ CBM_VEHICLE_REFIT_CAPACITY
Cargo capacity after refit.
uint16 reliability_final
Final reliability of the engine.
const uint8 _engine_offsets[4]
Offset of the first engine of each vehicle type in original engine data.
static bool IsUniqueEngineName(const char *name)
Is name still free as name for an engine?
AISettings ai
what may the AI do?
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
void UnloadWagonOverrides(Engine *e)
Unload all wagon override sprite groups.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
bool ai_disable_veh_ship
disable types for AI
CompanyID _current_company
Company currently doing an action.
@ PROP_TRAIN_WEIGHT
Weight in t (if dualheaded: for each single vehicle)
std::string name
Custom name of engine.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
Base class for all pools.
void DeleteWindowById(WindowClass cls, WindowNumber number, bool force)
Delete a window by its class and window number (if it is open).
bool CanCarryCargo() const
Determines whether an engine can carry something.
UnitID max_trains
max trains in game per company
void SetRandomSeed(uint32 seed)
(Re)set the state of the random number generators.
@ WC_BUILD_VEHICLE
Build vehicle; Window numbers:
static Aircraft * From(Vehicle *v)
Converts a Vehicle to SpecializedVehicle with type checking.
uint GetPower() const
Returns the power of the engine for display and sorting purposes.
@ RAILTYPE_END
Used for iterations.
@ EF_NO_DEFAULT_CARGO_MULTIPLIER
Use the new capacity algorithm. The default cargotype of the vehicle does not affect capacity multipl...
void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope)
Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by de...
bool IsNormalAircraft() const
Check if the aircraft type is a normal flying device; eg not a rotor or a shadow.
Stores the mapping of EngineID to the internal id of newgrfs.
@ RAILVEH_MULTIHEAD
indicates a combination of two locomotives
@ TRANSPORT_WATER
Transport over water.
RailTypes GetCompanyRailtypes(CompanyID company, bool introduces)
Get the rail types the given company can build.
bool ai_disable_veh_aircraft
disable types for AI
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function()
static const int DAYS_IN_YEAR
days per year
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
@ TRANSPORT_AIR
Transport through air.
static void NewVehicleAvailable(Engine *e)
An engine has become available for general use.
@ PROP_ROADVEH_CARGO_CAPACITY
Capacity.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
Year starting_year
starting date
UnitID max_roadveh
max trucks in game per company
uint8 original_image_index
Original vehicle image index, thus the image index of the overridden vehicle.
#define INSTANTIATE_POOL_METHODS(name)
Force instantiation of pool methods so we don't get linker errors.
uint16 multiplier
Capacity multiplier for vehicles. (8 fractional bits)
void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceType reftype1=NR_NONE, uint32 ref1=UINT32_MAX, NewsReferenceType reftype2=NR_NONE, uint32 ref2=UINT32_MAX, void *free_data=nullptr)
Add a new newsitem to be shown.
@ AIR_CTOL
Conventional Take Off and Landing, i.e. planes.
@ NF_VEHICLE
Vehicle news item. (new engine available)
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
#define lengthof(x)
Return the length of an fixed size array.
Data structure to convert between Date and triplet (year, month, and day).
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
@ CBID_VEHICLE_REFIT_CAPACITY
Refit capacity, the passed vehicle needs to have its ->cargo_type set to the cargo we are refitting t...
uint DetermineCapacity(const Vehicle *v, uint16 *mail_capacity=nullptr) const
Determines capacity of a given vehicle from scratch.
byte CargoID
Cargo slots to indicate a cargo type within a game.
bool never_expire_vehicles
never expire vehicles
bool IsEnabled() const
Checks whether the engine is a valid (non-articulated part of an) engine.
@ INVALID_COMPANY
An invalid company.
@ PROP_SHIP_COST_FACTOR
Purchase cost.
CargoID cargo_type
type of cargo this vehicle is carrying
GRFFilePropsBase< NUM_CARGO+2 > grf_prop
Properties related the the grf file.
uint16 local_id
id defined by the grf file for this entity
VehicleSettings vehicle
options for vehicles
byte cargo_subtype
Used for livery refits (NewGRF variations)
byte climates
Climates supported by the engine.
@ PROP_SHIP_SPEED
Max. speed: 1 unit = 1/3.2 mph = 0.5 km-ish/h.
@ PROP_AIRCRAFT_PASSENGER_CAPACITY
Passenger Capacity.
bool IsEngineRefittable(EngineID engine)
Check if an engine is refittable.
@ PROP_ROADVEH_POWER
Power in 10 HP.
@ VEH_TRAIN
Train vehicle type.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
@ PROP_TRAIN_COST_FACTOR
Purchase cost (if dualheaded: sum of both vehicles)
@ PROP_AIRCRAFT_SPEED
Max. speed: 1 unit = 8 mph = 12.8 km-ish/h.
uint16 GetRange() const
Get the range of an aircraft type.
VehicleType type
The engine type.
byte flags
Flags of the engine.
StringID string_id
Default name of engine.
void ClearEnginesHiddenFlagOfCompany(CompanyID cid)
Clear the 'hidden' flag for all engines of a new company.
CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Set the visibility of an engine.
@ CT_INVALID
Invalid cargo type.
static bool IsCargoInClass(CargoID c, CargoClass cc)
Does cargo c have cargo class cc?
@ PROP_TRAIN_POWER
Power in hp (if dualheaded: sum of both vehicles)
CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Accept an engine prototype.
void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type)
When an engine is made buildable or is removed from being buildable, add/remove it from the build/aut...
@ VEH_SHIP
Ship vehicle type.
@ ROADTYPES_NONE
No roadtypes.
@ PROP_ROADVEH_RUNNING_COST_FACTOR
Yearly runningcost.
@ WC_MAIN_TOOLBAR
Main toolbar (the long bar at the top); Window numbers:
void SetWindowClassesDirty(WindowClass cls)
Mark all windows of a particular class as dirty (in need of repainting)
@ PROP_AIRCRAFT_RANGE
Aircraft range.
uint16 cargo_age_period
Number of ticks before carried cargo is aged.
void SetYearEngineAgingStops()
Compute the value for _year_engine_aging_stops.
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
Date intro_date
Date of introduction of the engine.
StringID GetAircraftTypeText() const
Get the name of the aircraft type for display purposes.
static const uint NUM_DEFAULT_ENGINES
Number of default entries.
@ NR_ENGINE
Reference engine.
Dynamic data of a loaded NewGRF.
uint16 reliability
Current reliability of the engine.
VehicleType type
Vehicle type, ie VEH_ROAD, VEH_TRAIN, etc.
static void AcceptEnginePreview(EngineID eid, CompanyID company)
Company company accepts engine eid for preview.
uint16 duration_phase_2
Second reliability phase in months, keeping reliability_max.
@ PROP_ROADVEH_WEIGHT
Weight in 1/4 t.
RailTypes introduces_railtypes
Bitmask of which other railtypes are introduced when this railtype is introduced.