src/vehicle.h
branchgamebalance
changeset 9912 1ac8aac92385
parent 9911 0b8b245a2391
child 9913 e79cd19772dd
equal deleted inserted replaced
9911:0b8b245a2391 9912:1ac8aac92385
     6 #define VEHICLE_H
     6 #define VEHICLE_H
     7 
     7 
     8 #include "oldpool.h"
     8 #include "oldpool.h"
     9 #include "order.h"
     9 #include "order.h"
    10 #include "rail.h"
    10 #include "rail.h"
       
    11 #include "road.h"
    11 
    12 
    12 /** The returned bits of VehicleEnterTile. */
    13 /** The returned bits of VehicleEnterTile. */
    13 enum VehicleEnterTileStatus {
    14 enum VehicleEnterTileStatus {
    14 	VETS_ENTERED_STATION  = 1, ///< The vehicle entered a station
    15 	VETS_ENTERED_STATION  = 1, ///< The vehicle entered a station
    15 	VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
    16 	VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
   186 	byte overtaking_ctr;
   187 	byte overtaking_ctr;
   187 	uint16 crashed_ctr;
   188 	uint16 crashed_ctr;
   188 	byte reverse_ctr;
   189 	byte reverse_ctr;
   189 	struct RoadStop *slot;
   190 	struct RoadStop *slot;
   190 	byte slot_age;
   191 	byte slot_age;
       
   192 	EngineID first_engine;
       
   193 	byte cached_veh_length;
       
   194 
       
   195 	RoadType roadtype;
       
   196 	RoadTypes compatible_roadtypes;
   191 };
   197 };
   192 
   198 
   193 struct VehicleSpecial {
   199 struct VehicleSpecial {
   194 	uint16 unk0;
   200 	uint16 unk0;
   195 	byte unk2;
   201 	byte unk2;
   393 
   399 
   394 	/**
   400 	/**
   395 	 * Play the sound associated with leaving the station
   401 	 * Play the sound associated with leaving the station
   396 	 */
   402 	 */
   397 	virtual void PlayLeaveStationSound() const {}
   403 	virtual void PlayLeaveStationSound() const {}
       
   404 
       
   405 	/**
       
   406 	 * Whether this is the primary vehicle in the chain.
       
   407 	 */
       
   408 	virtual bool IsPrimaryVehicle() const { return false; }
       
   409 
       
   410 	/**
       
   411 	 * Whether this vehicle understands the concept of a front engine, so
       
   412 	 * basically, if GetFirstVehicleInChain() can be called for it.
       
   413 	 */
       
   414 	virtual bool HasFront() const { return false; }
   398 };
   415 };
   399 
   416 
   400 /**
   417 /**
   401  * This class 'wraps' Vehicle; you do not actually instantiate this class.
   418  * This class 'wraps' Vehicle; you do not actually instantiate this class.
   402  * You create a Vehicle using AllocateVehicle, so it is added to the pool
   419  * You create a Vehicle using AllocateVehicle, so it is added to the pool