summaryrefslogtreecommitdiff
path: root/src/cargotype.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-11-05 19:46:17 +0000
committerfrosch <frosch@openttd.org>2009-11-05 19:46:17 +0000
commit79627b4f8952da6a6d6132d9428ce037aeaae9df (patch)
tree6b9df6eb573db144ea20096edad74759d7a742d6 /src/cargotype.h
parentb92c6b3741500439521019ca28690b456712df2a (diff)
downloadopenttd-79627b4f8952da6a6d6132d9428ce037aeaae9df.tar.xz
(svn r17976) -Codechange: Move CargoClass to cargotype.h and clean up including of newgrf_cargo.h
Diffstat (limited to 'src/cargotype.h')
-rw-r--r--src/cargotype.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cargotype.h b/src/cargotype.h
index 61814dd6f..ef7e76ee8 100644
--- a/src/cargotype.h
+++ b/src/cargotype.h
@@ -29,6 +29,20 @@ enum TownEffect {
TE_FOOD,
};
+enum CargoClass {
+ CC_NOAVAILABLE = 0, ///< No cargo class has been specified
+ CC_PASSENGERS = 1 << 0, ///< Passengers
+ CC_MAIL = 1 << 1, ///< Mail
+ CC_EXPRESS = 1 << 2, ///< Express cargo (Goods, Food, Candy, but also possible for passengers)
+ CC_ARMOURED = 1 << 3, ///< Armoured cargo (Valuables, Gold, Diamonds)
+ CC_BULK = 1 << 4, ///< Bulk cargo (Coal, Grain etc., Ores, Fruit)
+ CC_PIECE_GOODS = 1 << 5, ///< Piece goods (Livestock, Wood, Steel, Paper)
+ CC_LIQUID = 1 << 6, ///< Liquids (Oil, Water, Rubber)
+ CC_REFRIGERATED = 1 << 7, ///< Refrigerated cargo (Food, Fruit)
+ CC_HAZARDOUS = 1 << 8, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.)
+ CC_COVERED = 1 << 9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.)
+ CC_SPECIAL = 1 << 15 ///< Special bit used for livery refit tricks instead of normal cargoes.
+};
static const byte INVALID_CARGO = 0xFF;
@@ -115,7 +129,7 @@ SpriteID GetCargoSprite(CargoID i);
CargoID GetCargoIDByLabel(CargoLabel cl);
CargoID GetCargoIDByBitnum(uint8 bitnum);
-static inline bool IsCargoInClass(CargoID c, uint16 cc)
+static inline bool IsCargoInClass(CargoID c, CargoClass cc)
{
return (CargoSpec::Get(c)->classes & cc) != 0;
}