TBTR: Refactor train/template match function to return difference flags
This commit is contained in:
@@ -55,8 +55,16 @@ void TransferCargoForTrain(Train *old_veh, Train *new_head);
|
||||
|
||||
void NeutralizeStatus(Train *t);
|
||||
|
||||
bool TrainMatchesTemplate(const Train *t, const TemplateVehicle *tv);
|
||||
bool TrainMatchesTemplateRefit(const Train *t, const TemplateVehicle *tv);
|
||||
enum TBTRDiffFlags {
|
||||
TBTRDF_NONE = 0, ///< no difference between train and template
|
||||
TBTRDF_CONSIST = 1 << 0, ///< consist (vehicle units) differs between train and template
|
||||
TBTRDF_REFIT = 1 << 1, ///< refit differs between train and template
|
||||
TBTRDF_DIR = 1 << 2, ///< unit direction differs between train and template
|
||||
TBTRDF_ALL = TBTRDF_CONSIST | TBTRDF_REFIT | TBTRDF_DIR,
|
||||
};
|
||||
DECLARE_ENUM_AS_BIT_SET(TBTRDiffFlags)
|
||||
|
||||
TBTRDiffFlags TrainTemplateDifference(const Train *t, const TemplateVehicle *tv);
|
||||
|
||||
void UpdateAllTemplateVehicleImages();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user