src/roadveh.h
branchNewGRF_ports
changeset 6719 4cc327ad39d5
parent 6585 7da94b26498a
child 6720 35756db7e577
equal deleted inserted replaced
6718:5a8b295aa345 6719:4cc327ad39d5
     1 /* $Id$ */
     1 /* $Id$ */
       
     2 
       
     3 /** @file src/roadveh.h Road vehicle states */
     2 
     4 
     3 #ifndef ROADVEH_H
     5 #ifndef ROADVEH_H
     4 #define ROADVEH_H
     6 #define ROADVEH_H
     5 
     7 
     6 #include "vehicle.h"
     8 #include "vehicle.h"
    18 }
    20 }
    19 
    21 
    20 void CcBuildRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    22 void CcBuildRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    21 void CcCloneRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    23 void CcCloneRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
    22 
    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 	bool IsPrimaryVehicle() const { return true; }
       
    47 };
       
    48 
    23 #endif /* ROADVEH_H */
    49 #endif /* ROADVEH_H */