288 int32 left_coord; |
288 int32 left_coord; |
289 int32 top_coord; |
289 int32 top_coord; |
290 int32 right_coord; |
290 int32 right_coord; |
291 int32 bottom_coord; |
291 int32 bottom_coord; |
292 Vehicle *next_hash; |
292 Vehicle *next_hash; |
|
293 Vehicle *next_new_hash; |
|
294 Vehicle **old_new_hash; |
293 |
295 |
294 /* Related to age and service time */ |
296 /* Related to age and service time */ |
295 Date age; // Age in days |
297 Date age; // Age in days |
296 Date max_age; // Maximum age |
298 Date max_age; // Maximum age |
297 Date date_of_last_service; |
299 Date date_of_last_service; |
495 Vehicle *GetFirstVehicleInChain(const Vehicle *v); |
497 Vehicle *GetFirstVehicleInChain(const Vehicle *v); |
496 uint CountVehiclesInChain(const Vehicle* v); |
498 uint CountVehiclesInChain(const Vehicle* v); |
497 bool IsEngineCountable(const Vehicle *v); |
499 bool IsEngineCountable(const Vehicle *v); |
498 void DeleteVehicleChain(Vehicle *v); |
500 void DeleteVehicleChain(Vehicle *v); |
499 void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc); |
501 void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc); |
|
502 void *VehicleFromPosXY(int x, int y, void *data, VehicleFromPosProc *proc); |
500 void CallVehicleTicks(); |
503 void CallVehicleTicks(); |
501 Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z); |
504 Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z); |
502 |
505 |
503 void InitializeTrains(); |
506 void InitializeTrains(); |
504 byte VehicleRandomBits(); |
507 byte VehicleRandomBits(); |
505 void ResetVehiclePosHash(); |
508 void ResetVehiclePosHash(); |
506 |
509 |
507 bool CanRefitTo(EngineID engine_type, CargoID cid_to); |
510 bool CanRefitTo(EngineID engine_type, CargoID cid_to); |
508 CargoID FindFirstRefittableCargo(EngineID engine_type); |
511 CargoID FindFirstRefittableCargo(EngineID engine_type); |
509 int32 GetRefitCost(EngineID engine_type); |
512 CommandCost GetRefitCost(EngineID engine_type); |
510 |
513 |
511 void ViewportAddVehicles(DrawPixelInfo *dpi); |
514 void ViewportAddVehicles(DrawPixelInfo *dpi); |
512 |
515 |
513 /* train_cmd.h */ |
516 /* train_cmd.h */ |
514 int GetTrainImage(const Vehicle* v, Direction direction); |
517 int GetTrainImage(const Vehicle* v, Direction direction); |
551 |
554 |
552 bool VehicleNeedsService(const Vehicle *v); |
555 bool VehicleNeedsService(const Vehicle *v); |
553 |
556 |
554 uint GenerateVehicleSortList(const Vehicle*** sort_list, uint16 *length_of_array, VehicleType type, PlayerID owner, uint32 index, uint16 window_type); |
557 uint GenerateVehicleSortList(const Vehicle*** sort_list, uint16 *length_of_array, VehicleType type, PlayerID owner, uint32 index, uint16 window_type); |
555 void BuildDepotVehicleList(VehicleType type, TileIndex tile, Vehicle ***engine_list, uint16 *engine_list_length, uint16 *engine_count, Vehicle ***wagon_list, uint16 *wagon_list_length, uint16 *wagon_count); |
558 void BuildDepotVehicleList(VehicleType type, TileIndex tile, Vehicle ***engine_list, uint16 *engine_list_length, uint16 *engine_count, Vehicle ***wagon_list, uint16 *wagon_list_length, uint16 *wagon_count); |
556 int32 SendAllVehiclesToDepot(VehicleType type, uint32 flags, bool service, PlayerID owner, uint16 vlw_flag, uint32 id); |
559 CommandCost SendAllVehiclesToDepot(VehicleType type, uint32 flags, bool service, PlayerID owner, uint16 vlw_flag, uint32 id); |
557 bool IsVehicleInDepot(const Vehicle *v); |
560 bool IsVehicleInDepot(const Vehicle *v); |
558 void VehicleEnterDepot(Vehicle *v); |
561 void VehicleEnterDepot(Vehicle *v); |
559 |
562 |
560 void InvalidateAutoreplaceWindow(EngineID e); |
563 void InvalidateAutoreplaceWindow(EngineID e); |
561 |
564 |
562 int32 MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs); |
565 CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs); |
563 |
566 |
564 /* Flags to add to p2 for goto depot commands */ |
567 /* Flags to add to p2 for goto depot commands */ |
565 /* Note: bits 8-10 are used for VLW flags */ |
568 /* Note: bits 8-10 are used for VLW flags */ |
566 enum { |
569 enum { |
567 DEPOT_SERVICE = (1 << 0), // The vehicle will leave the depot right after arrival (serivce only) |
570 DEPOT_SERVICE = (1 << 0), // The vehicle will leave the depot right after arrival (serivce only) |