18 uint8 weight; |
27 uint8 weight; |
19 uint16 initial_payment; |
28 uint16 initial_payment; |
20 uint8 transit_days[2]; |
29 uint8 transit_days[2]; |
21 |
30 |
22 bool is_freight; |
31 bool is_freight; |
23 uint8 substitutetowngrowth; |
32 TownEffect town_effect; ///< The effect this cargo type has on towns |
24 uint16 multipliertowngrowth; |
33 uint16 multipliertowngrowth; |
25 uint8 callbackflags; |
34 uint8 callback_mask; |
26 |
35 |
27 StringID name; |
36 StringID name; |
28 StringID name_plural; |
37 StringID name_plural; |
29 StringID units_volume; |
38 StringID units_volume; |
30 StringID quantifier; |
39 StringID quantifier; |
31 StringID abbrev; |
40 StringID abbrev; |
32 |
41 |
33 SpriteID sprite; |
42 SpriteID sprite; |
34 |
43 |
35 uint16 classes; |
44 uint16 classes; |
|
45 const struct SpriteGroup *group; |
36 |
46 |
37 bool IsValid() const; |
47 bool IsValid() const; |
38 }; |
48 }; |
39 |
49 |
40 |
50 |
41 extern uint32 _cargo_mask; |
51 extern uint32 _cargo_mask; |
|
52 extern CargoSpec _cargo[NUM_CARGO]; |
42 |
53 |
43 |
54 |
44 /* Set up the default cargo types for the given landscape type */ |
55 /* Set up the default cargo types for the given landscape type */ |
45 void SetupCargoForClimate(LandscapeID l); |
56 void SetupCargoForClimate(LandscapeID l); |
46 /* Retrieve cargo details for the given cargo ID */ |
57 /* Retrieve cargo details for the given cargo ID */ |
47 const CargoSpec *GetCargo(CargoID c); |
58 const CargoSpec *GetCargo(CargoID c); |
48 /* Get the cargo ID with the cargo label */ |
59 /* Get the cargo ID with the cargo label */ |
49 CargoID GetCargoIDByLabel(CargoLabel cl); |
60 CargoID GetCargoIDByLabel(CargoLabel cl); |
50 |
61 |
|
62 static inline bool IsCargoInClass(CargoID c, uint16 cc) |
|
63 { |
|
64 return (GetCargo(c)->classes & cc) != 0; |
|
65 } |
|
66 |
51 |
67 |
52 #endif /* CARGOTYPE_H */ |
68 #endif /* CARGOTYPE_H */ |