src/train.h
changeset 7048 06b931095b26
parent 6918 5589c415e28f
child 7049 01825af2ce90
equal deleted inserted replaced
7047:578d7e38b601 7048:06b931095b26
   226 void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2);
   226 void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2);
   227 void CcCloneTrain(bool success, TileIndex tile, uint32 p1, uint32 p2);
   227 void CcCloneTrain(bool success, TileIndex tile, uint32 p1, uint32 p2);
   228 
   228 
   229 byte FreightWagonMult(CargoID cargo);
   229 byte FreightWagonMult(CargoID cargo);
   230 
   230 
       
   231 /**
       
   232  * This class 'wraps' Vehicle; you do not actually instantiate this class.
       
   233  * You create a Vehicle using AllocateVehicle, so it is added to the pool
       
   234  * and you reinitialize that to a Train using:
       
   235  *   v = new (v) Train();
       
   236  *
       
   237  * As side-effect the vehicle type is set correctly.
       
   238  */
       
   239 struct Train : public Vehicle {
       
   240 	/** Initializes the Vehicle to a train */
       
   241 	Train() { this->type = VEH_TRAIN; }
       
   242 
       
   243 	/** We want to 'destruct' the right class. */
       
   244 	virtual ~Train() {}
       
   245 
       
   246 	const char *GetTypeString() { return "train"; }
       
   247 };
       
   248 
   231 #endif /* TRAIN_H */
   249 #endif /* TRAIN_H */