--- a/src/engine.h Tue Mar 27 23:27:27 2007 +0000
+++ b/src/engine.h Sat Jun 02 19:59:29 2007 +0000
@@ -16,6 +16,14 @@
RAILVEH_WAGON, ///< simple wagon, not motorized
};
+enum EngineClass {
+ EC_STEAM,
+ EC_DIESEL,
+ EC_ELECTRIC,
+ EC_MONORAIL,
+ EC_MAGLEV,
+};
+
struct RailVehicleInfo {
byte image_index;
RailVehicleTypes railveh_type;
@@ -26,7 +34,7 @@
uint16 weight;
byte running_cost_base;
byte running_cost_class;
- byte engclass; ///< 0: steam, 1: diesel, 2: electric
+ EngineClass engclass; ///< Class of engine for this vehicle
byte capacity;
CargoID cargo_type;
byte ai_rank;
@@ -90,13 +98,14 @@
Date base_intro;
Year lifelength;
Year base_life;
- byte unk2; ///< Carriages have the highest bit set in this one
+ byte unk2; ///< flag for carriage(bit 7) and decay speed(bits0..6)
byte load_amount;
byte climates;
uint32 refit_mask;
byte refit_cost;
byte misc_flags;
byte callbackmask;
+ byte retire_early; ///< Number of years early to retire vehicle
};
struct Engine {
@@ -111,15 +120,15 @@
PlayerByte preview_player;
byte preview_wait;
byte player_avail;
- byte type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc. Same as in vehicle.h
+ VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc. Same as in vehicle.h
};
/**
* EngineInfo.misc_flags is a bitmask, with the following values
*/
enum {
- EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves (unsupported)
- EF_ROAD_TRAM = 0, ///< Road vehicle is a tram/light rail vehicle (unsup)
+ EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves
+ EF_ROAD_TRAM = 0, ///< Road vehicle is a tram/light rail vehicle
EF_USES_2CC = 1, ///< Vehicle uses two company colours
EF_RAIL_IS_MU = 2, ///< Rail vehicle is a multiple-unit (DMU/EMU)
};
@@ -153,6 +162,7 @@
void DeleteCustomEngineNames();
bool IsEngineBuildable(EngineID engine, byte type, PlayerID player);
+CargoID GetEngineCargoType(EngineID engine);
enum {
NUM_NORMAL_RAIL_ENGINES = 54,
@@ -262,6 +272,7 @@
EngineID from;
EngineID to;
EngineRenew *next;
+ GroupID group_id;
};
/**
@@ -295,7 +306,7 @@
/**
* Remove all engine replacement settings for the player.
- * @param er The renewlist for a given player.
+ * @param erl The renewlist for a given player.
* @return The new renewlist for the player.
*/
void RemoveAllEngineReplacement(EngineRenewList* erl);
@@ -307,7 +318,7 @@
* @return The engine type to replace with, or INVALID_ENGINE if no
* replacement is in the list.
*/
-EngineID EngineReplacement(EngineRenewList erl, EngineID engine);
+EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group);
/**
* Add an engine replacement to the given renewlist.
@@ -317,7 +328,7 @@
* @param flags The calling command flags.
* @return 0 on success, CMD_ERROR on failure.
*/
-int32 AddEngineReplacement(EngineRenewList* erl, EngineID old_engine, EngineID new_engine, uint32 flags);
+int32 AddEngineReplacement(EngineRenewList* erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags);
/**
* Remove an engine replacement from a given renewlist.
@@ -326,12 +337,12 @@
* @param flags The calling command flags.
* @return 0 on success, CMD_ERROR on failure.
*/
-int32 RemoveEngineReplacement(EngineRenewList* erl, EngineID engine, uint32 flags);
+int32 RemoveEngineReplacement(EngineRenewList* erl, EngineID engine, GroupID group, uint32 flags);
/** When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists
* @param type The type of engine
*/
-void AddRemoveEngineFromAutoreplaceAndBuildWindows(byte type);
+void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type);
/* Engine list manipulators - current implementation is only C wrapper of CBlobT<EngineID> class (helpers.cpp) */
void EngList_Create(EngineList *el); ///< Creates engine list