Implementation of cargos. More...
#include "stdafx.h"#include "cargotype.h"#include "core/bitmath_func.hpp"#include "newgrf_cargo.h"#include "table/sprites.h"#include "table/strings.h"#include "table/cargo_const.h"Go to the source code of this file.
Functions | |
| void | SetupCargoForClimate (LandscapeID l) |
| Set up the default cargo types for the given landscape type. | |
| CargoID | GetCargoIDByLabel (CargoLabel cl) |
| Get the cargo ID by cargo label. | |
| CargoID | GetCargoIDByBitnum (uint8 bitnum) |
| Find the CargoID of a 'bitnum' value. | |
Variables | |
| uint32 | _cargo_mask |
| Bitmask of cargo types available. | |
Implementation of cargos.
Definition in file cargotype.cpp.
| CargoID GetCargoIDByBitnum | ( | uint8 | bitnum | ) |
Find the CargoID of a 'bitnum' value.
| bitnum | 'bitnum' to find. |
Definition at line 87 of file cargotype.cpp.
References CargoSpec::bitnum, CT_INVALID, CargoSpec::Index(), and INVALID_CARGO.
| CargoID GetCargoIDByLabel | ( | CargoLabel | cl | ) |
Get the cargo ID by cargo label.
| cl | Cargo type to get. |
Definition at line 71 of file cargotype.cpp.
References CT_INVALID, CargoSpec::Index(), and CargoSpec::label.
Referenced by CalculateRefitMasks().
| void SetupCargoForClimate | ( | LandscapeID | l | ) |
Set up the default cargo types for the given landscape type.
| l | Landscape |
Definition at line 31 of file cargotype.cpp.
References _cargo_mask, _default_cargo, _default_climate_cargo, CargoSpec::bitnum, CargoSpec::Get(), INVALID_CARGO, lengthof, and SetBit().
Referenced by ResetNewGRFData().
| uint32 _cargo_mask |
Bitmask of cargo types available.
Initialized during a call to SetupCargoForClimate.
Definition at line 26 of file cargotype.cpp.
Referenced by CalculateRefitMasks(), CompanyStationsWindow::OnClick(), RailVehicleChangeInfo(), SetupCargoForClimate(), ShipVehicleChangeInfo(), and ShowRefitOptionsList().
1.6.1