src/train.h
branchnoai
changeset 10142 56ee7da4ad56
parent 9869 6404afe43575
child 10294 7798ae816af8
equal deleted inserted replaced
10096:780921b39016 10142:56ee7da4ad56
     8 #include "stdafx.h"
     8 #include "stdafx.h"
     9 #include "core/bitmath_func.hpp"
     9 #include "core/bitmath_func.hpp"
    10 #include "vehicle_base.h"
    10 #include "vehicle_base.h"
    11 
    11 
    12 
    12 
    13 /*
    13 /** enum to handle train subtypes
    14  * enum to handle train subtypes
       
    15  * Do not access it directly unless you have to. Use the access functions below
    14  * Do not access it directly unless you have to. Use the access functions below
    16  * This is an enum to tell what bit to access as it is a bitmask
    15  * This is an enum to tell what bit to access as it is a bitmask
    17  */
    16  */
    18 
       
    19 enum TrainSubtype {
    17 enum TrainSubtype {
    20 	TS_FRONT             = 0, ///< Leading engine of a train
    18 	TS_FRONT             = 0, ///< Leading engine of a train
    21 	TS_ARTICULATED_PART  = 1, ///< Articulated part of an engine
    19 	TS_ARTICULATED_PART  = 1, ///< Articulated part of an engine
    22 	TS_WAGON             = 2, ///< Wagon
    20 	TS_WAGON             = 2, ///< Wagon
    23 	TS_ENGINE            = 3, ///< Engine, that can be front engines, but might be placed behind another engine
    21 	TS_ENGINE            = 3, ///< Engine, that can be front engines, but might be placed behind another engine
   305 	bool IsInDepot() const { return CheckTrainInDepot(this, false) != -1; }
   303 	bool IsInDepot() const { return CheckTrainInDepot(this, false) != -1; }
   306 	bool IsStoppedInDepot() const { return CheckTrainStoppedInDepot(this) >= 0; }
   304 	bool IsStoppedInDepot() const { return CheckTrainStoppedInDepot(this) >= 0; }
   307 	void Tick();
   305 	void Tick();
   308 	void OnNewDay();
   306 	void OnNewDay();
   309 	TileIndex GetOrderStationLocation(StationID station);
   307 	TileIndex GetOrderStationLocation(StationID station);
       
   308 	bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
   310 };
   309 };
   311 
   310 
   312 #endif /* TRAIN_H */
   311 #endif /* TRAIN_H */