1 // template_vehicle_func.h
2 #ifndef TEMPLATE_VEHICLE_FUNC_H
3 #define TEMPLATE_VEHICLE_FUNC_H
6 #include "window_gui.h"
8 #include "tbtr_template_vehicle.h"
10 //void DrawTemplateVehicle(TemplateVehicle*, int, const Rect&);
13 Train
* VirtualTrainFromTemplateVehicle(TemplateVehicle
* tv
, StringID
&err
);
15 void BuildTemplateGuiList(GUITemplateList
*, Scrollbar
*, Owner
, RailType
);
17 Money
CalculateOverallTemplateCost(const TemplateVehicle
*);
19 void DrawTemplate(const TemplateVehicle
*, int, int, int);
21 TemplateVehicle
* TemplateVehicleFromVirtualTrain(Train
*virt
);
23 Train
* DeleteVirtualTrain(Train
*, Train
*);
25 CommandCost
CmdTemplateReplaceVehicle(Train
*, bool, DoCommandFlag
);
29 void tbtr_debug_pat();
30 void tbtr_debug_pav();
31 void tbtr_debug_ptv(TemplateVehicle
*);
32 void tbtr_debug_pvt(const Train
*);
35 TemplateVehicle
* GetTemplateVehicleByGroupID(GroupID
);
36 bool ChainContainsVehicle(Train
*, Train
*);
37 Train
* ChainContainsEngine(EngineID
, Train
*);
38 Train
* DepotContainsEngine(TileIndex
, EngineID
, Train
*);
40 int NumTrainsNeedTemplateReplacement(GroupID
, TemplateVehicle
*);
42 CommandCost
TestBuyAllTemplateVehiclesInChain(TemplateVehicle
*tv
, TileIndex tile
);
44 void CmdRefitTrainFromTemplate(Train
*t
, TemplateVehicle
*tv
, DoCommandFlag
);
45 void BreakUpRemainders(Train
*t
);
47 bool TemplateVehicleContainsEngineOfRailtype(const TemplateVehicle
*, RailType
);
49 void TransferCargoForTrain(Train
*, Train
*);
51 void NeutralizeStatus(Train
*t
);
53 bool TrainMatchesTemplate(const Train
*t
, TemplateVehicle
*tv
);
54 bool TrainMatchesTemplateRefit(const Train
*t
, TemplateVehicle
*tv
);