(svn r11004) -Codechange: some reworks of the saveload mechanism to be able to save and load private and protected variables in the vehicle struct.

This commit is contained in:
rubidium
2007-08-30 13:09:44 +00:00
parent 235ad4ab6b
commit f830699971
8 changed files with 54 additions and 49 deletions

View File

@@ -218,11 +218,18 @@ struct VehicleShip {
struct Vehicle;
DECLARE_OLD_POOL(Vehicle, Vehicle, 9, 125)
struct SaveLoad;
extern const SaveLoad *GetVehicleDescription(VehicleType vt);
struct Vehicle : PoolItem<Vehicle, VehicleID, &_Vehicle_pool> {
VehicleTypeByte type; ///< Type of vehicle
byte subtype; // subtype (Filled with values from EffectVehicles/TrainSubTypes/AircraftSubTypes)
private:
Vehicle *next; // pointer to the next vehicle in the chain
public:
friend const SaveLoad *GetVehicleDescription(VehicleType vt); // So we can use private/protected variables in the saveload code
Vehicle *first; // NOSAVE: pointer to the first vehicle in the chain
Vehicle *depot_list; // NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace