src/roadveh.h
branchgamebalance
changeset 9911 0b8b245a2391
parent 9908 0fa543611bbe
child 9625 3301b1b3889c
child 9912 1ac8aac92385
equal deleted inserted replaced
9910:0b2aebc8283e 9911:0b8b245a2391
    20 }
    20 }
    21 
    21 
    22 void CcBuildRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    22 void CcBuildRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    23 void CcCloneRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    23 void CcCloneRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    24 
    24 
       
    25 
       
    26 /**
       
    27  * This class 'wraps' Vehicle; you do not actually instantiate this class.
       
    28  * You create a Vehicle using AllocateVehicle, so it is added to the pool
       
    29  * and you reinitialize that to a Train using:
       
    30  *   v = new (v) RoadVehicle();
       
    31  *
       
    32  * As side-effect the vehicle type is set correctly.
       
    33  */
       
    34 struct RoadVehicle : public Vehicle {
       
    35 	/** Initializes the Vehicle to a road vehicle */
       
    36 	RoadVehicle() { this->type = VEH_ROAD; }
       
    37 
       
    38 	/** We want to 'destruct' the right class. */
       
    39 	virtual ~RoadVehicle() {}
       
    40 
       
    41 	const char *GetTypeString() const { return "road vehicle"; }
       
    42 	void MarkDirty();
       
    43 	void UpdateDeltaXY(Direction direction);
       
    44 	ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_ROADVEH_INC : EXPENSES_ROADVEH_RUN; }
       
    45 	WindowClass GetVehicleListWindowClass() const { return WC_ROADVEH_LIST; }
       
    46 };
       
    47 
    25 #endif /* ROADVEH_H */
    48 #endif /* ROADVEH_H */