(svn r17976) -Codechange: Move CargoClass to cargotype.h and clean up including of newgrf_cargo.h

This commit is contained in:
frosch 2009-11-05 19:46:17 +00:00
parent b92c6b3741
commit 79627b4f89
20 changed files with 21 additions and 28 deletions

View File

@ -14,7 +14,6 @@
#include "../../economy_func.h"
#include "../../core/alloc_func.hpp"
#include "../../core/bitmath_func.hpp"
#include "../../newgrf_cargo.h"
/* static */ bool AICargo::IsValidCargo(CargoID cargo_type)
{

View File

@ -35,7 +35,6 @@
#include "effectvehicle_func.h"
#include "station_base.h"
#include "cargotype.h"
#include "newgrf_cargo.h"
#include "table/strings.h"
#include "table/sprites.h"

View File

@ -31,7 +31,6 @@
#include "window_gui.h"
#include "engine_gui.h"
#include "cargotype.h"
#include "newgrf_cargo.h"
#include "table/sprites.h"
#include "table/strings.h"

View File

@ -10,7 +10,6 @@
/** @file cargotype.cpp Implementation of cargos. */
#include "stdafx.h"
#include "newgrf_cargo.h"
#include "cargotype.h"
#include "core/bitmath_func.hpp"

View File

@ -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;
}

View File

@ -23,6 +23,7 @@
#include "ai/ai.hpp"
#include "aircraft.h"
#include "train.h"
#include "newgrf_cargo.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
#include "newgrf_industries.h"

View File

@ -25,6 +25,7 @@
#include "genworld.h"
#include "tree_map.h"
#include "newgrf.h"
#include "newgrf_cargo.h"
#include "newgrf_commons.h"
#include "newgrf_industries.h"
#include "newgrf_industrytiles.h"

View File

@ -33,7 +33,6 @@
#include "fios.h"
#include "zoom_func.h"
#include "window_func.h"
#include "newgrf_cargo.h"
#include "tilehighlight_func.h"
#include "querystring_gui.h"

View File

@ -27,6 +27,7 @@
#include "fontcache.h"
#include "currency.h"
#include "landscape.h"
#include "newgrf_cargo.h"
#include "newgrf_house.h"
#include "newgrf_sound.h"
#include "newgrf_station.h"

View File

@ -16,21 +16,6 @@
#include "cargo_type.h"
#include "gfx_type.h"
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 CargoID CT_DEFAULT = NUM_CARGO + 0;
static const CargoID CT_PURCHASE = NUM_CARGO + 1;
static const CargoID CT_DEFAULT_NA = NUM_CARGO + 2;

View File

@ -15,6 +15,7 @@
#include "roadveh.h"
#include "company_func.h"
#include "newgrf.h"
#include "newgrf_cargo.h"
#include "newgrf_engine.h"
#include "newgrf_spritegroup.h"
#include "date_func.h"

View File

@ -21,7 +21,6 @@
#include "core/pool_type.hpp"
#include "house_type.h"
#include "newgrf_cargo.h"
#include "newgrf_callbacks.h"
#include "newgrf_generic.h"
#include "newgrf_storage.h"

View File

@ -16,6 +16,7 @@
#include "station_base.h"
#include "waypoint_base.h"
#include "roadstop_base.h"
#include "newgrf_cargo.h"
#include "newgrf_commons.h"
#include "newgrf_station.h"
#include "newgrf_spritegroup.h"

View File

@ -14,7 +14,6 @@
#include "engine_type.h"
#include "newgrf_callbacks.h"
#include "newgrf_cargo.h"
#include "tile_type.h"
#include "station_type.h"
#include "strings_type.h"

View File

@ -19,7 +19,6 @@
#include "strings_func.h"
#include "functions.h"
#include "window_func.h"
#include "newgrf_cargo.h"
#include "timetable.h"
#include "vehicle_func.h"
#include "depot_base.h"

View File

@ -23,7 +23,6 @@
#include "window_func.h"
#include "vehicle_func.h"
#include "company_func.h"
#include "newgrf_cargo.h"
#include "widgets/dropdown_func.h"
#include "textbuf_gui.h"
#include "string_func.h"

View File

@ -36,7 +36,6 @@
#include "effectvehicle_func.h"
#include "roadstop_base.h"
#include "cargotype.h"
#include "newgrf_cargo.h"
#include "table/strings.h"
#include "table/sprites.h"

View File

@ -22,6 +22,7 @@
#include "train.h"
#include "roadveh.h"
#include "industry.h"
#include "newgrf_cargo.h"
#include "newgrf_station.h"
#include "newgrf_commons.h"
#include "yapf/yapf.h"

View File

@ -36,7 +36,6 @@
#include "clear_map.h"
#include "tree_map.h"
#include "aircraft.h"
#include "newgrf_cargo.h"
#include "effectvehicle_func.h"
#include "tunnelbridge_map.h"
#include "station_base.h"

View File

@ -12,7 +12,6 @@
#include "../stdafx.h"
#include "../roadstop_base.h"
#include "../cargotype.h"
#include "../newgrf_cargo.h"
#include "yapf.hpp"
#include "yapf_node_road.hpp"