src/ship.h
changeset 7048 06b931095b26
parent 6916 e87d54a598ea
child 7049 01825af2ce90
equal deleted inserted replaced
7047:578d7e38b601 7048:06b931095b26
    21 static inline bool IsShipInDepotStopped(const Vehicle* v)
    21 static inline bool IsShipInDepotStopped(const Vehicle* v)
    22 {
    22 {
    23 	return IsShipInDepot(v) && v->vehstatus & VS_STOPPED;
    23 	return IsShipInDepot(v) && v->vehstatus & VS_STOPPED;
    24 }
    24 }
    25 
    25 
       
    26 
       
    27 /**
       
    28  * This class 'wraps' Vehicle; you do not actually instantiate this class.
       
    29  * You create a Vehicle using AllocateVehicle, so it is added to the pool
       
    30  * and you reinitialize that to a Train using:
       
    31  *   v = new (v) Ship();
       
    32  *
       
    33  * As side-effect the vehicle type is set correctly.
       
    34  */
       
    35 struct Ship: public Vehicle {
       
    36 	/** Initializes the Vehicle to a ship */
       
    37 	Ship() { this->type = VEH_SHIP; }
       
    38 
       
    39 	/** We want to 'destruct' the right class. */
       
    40 	virtual ~Ship() {}
       
    41 
       
    42 	const char *GetTypeString() { return "ship"; }
       
    43 };
       
    44 
    26 #endif /* SHIP_H */
    45 #endif /* SHIP_H */