OpenTTD

roadveh.h
Go to the documentation of this file.
1 /* $Id: roadveh.h 27666 2016-10-16 14:57:56Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef ROADVEH_H
13 #define ROADVEH_H
14
15 #include "ground_vehicle.hpp"
16 #include "engine_base.h"
17 #include "cargotype.h"
18 #include "track_func.h"
19 #include "road_type.h"
20 #include "newgrf_engine.h"
21
22 struct RoadVehicle;
23
25 enum RoadVehicleStates {
26 /*
27 * Lower 4 bits are used for vehicle track direction. (Trackdirs)
28 * When in a road stop (bit 5 or bit 6 set) these bits give the
29 * track direction of the entry to the road stop.
30 * As the entry direction will always be a diagonal
31 * direction (X_NE, Y_SE, X_SW or Y_NW) only bits 0 and 3
32 * are needed to hold this direction. Bit 1 is then used to show
33 * that the vehicle is using the second road stop bay.
34 * Bit 2 is then used for drive-through stops to show the vehicle
35 * is stopping at this road stop.
36 */
37
38 /* Numeric values */
39 RVSB_IN_DEPOT = 0xFE,
40 RVSB_WORMHOLE = 0xFF,
41
42 /* Bit numbers */
43 RVS_USING_SECOND_BAY = 1,
44 RVS_ENTERED_STOP = 2,
45 RVS_DRIVE_SIDE = 4,
46 RVS_IN_ROAD_STOP = 5,
47 RVS_IN_DT_ROAD_STOP = 6,
48
49 /* Bit sets of the above specified bits */
50 RVSB_IN_ROAD_STOP = 1 << RVS_IN_ROAD_STOP,
51 RVSB_IN_ROAD_STOP_END = RVSB_IN_ROAD_STOP + TRACKDIR_END,
52 RVSB_IN_DT_ROAD_STOP = 1 << RVS_IN_DT_ROAD_STOP,
53 RVSB_IN_DT_ROAD_STOP_END = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END,
54
55 RVSB_DRIVE_SIDE = 1 << RVS_DRIVE_SIDE,
56
57 RVSB_TRACKDIR_MASK = 0x0F,
58 RVSB_ROAD_STOP_TRACKDIR_MASK = 0x09,
59 };
60
62 static const uint RDE_NEXT_TILE = 0x80;
63 static const uint RDE_TURNED = 0x40;
64
65 /* Start frames for when a vehicle enters a tile/changes its state.
66 * The start frame is different for vehicles that turned around or
67 * are leaving the depot as the do not start at the edge of the tile.
68 * For trams there are a few different start frames as there are two
69 * places where trams can turn. */
70 static const uint RVC_DEFAULT_START_FRAME = 0;
71 static const uint RVC_TURN_AROUND_START_FRAME = 1;
72 static const uint RVC_DEPOT_START_FRAME = 6;
73 static const uint RVC_START_FRAME_AFTER_LONG_TRAM = 21;
74 static const uint RVC_TURN_AROUND_START_FRAME_SHORT_TRAM = 16;
75 /* Stop frame for a vehicle in a drive-through stop */
76 static const uint RVC_DRIVE_THROUGH_STOP_FRAME = 11;
77 static const uint RVC_DEPOT_STOP_FRAME = 11;
78
80 static const byte RV_OVERTAKE_TIMEOUT = 35;
81
82 void RoadVehUpdateCache(RoadVehicle *v, bool same_length = false);
83 void GetRoadVehSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type);
84
88 struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
89 byte state;
90 byte frame;
91 uint16 blocked_ctr;
92 byte overtaking;
93 byte overtaking_ctr;
94 uint16 crashed_ctr;
95 byte reverse_ctr;
96
97 RoadType roadtype;
98 RoadTypes compatible_roadtypes;
99
101 RoadVehicle() : GroundVehicleBase() {}
103 virtual ~RoadVehicle() { this->PreDestructor(); }
104
105 friend struct GroundVehicle<RoadVehicle, VEH_ROAD>; // GroundVehicle needs to use the acceleration functions defined at RoadVehicle.
106
107 void MarkDirty();
108 void UpdateDeltaXY(Direction direction);
109 ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_ROADVEH_INC : EXPENSES_ROADVEH_RUN; }
110 bool IsPrimaryVehicle() const { return this->IsFrontEngine(); }
111 void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const;
112 int GetDisplaySpeed() const { return this->gcache.last_speed / 2; }
113 int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed / 2; }
114 Money GetRunningCost() const;
115 int GetDisplayImageWidth(Point *offset = NULL) const;
116 bool IsInDepot() const { return this->state == RVSB_IN_DEPOT; }
117 bool Tick();
118 void OnNewDay();
119 uint Crash(bool flooded = false);
120 Trackdir GetVehicleTrackdir() const;
121 TileIndex GetOrderStationLocation(StationID station);
122 bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
123
124 bool IsBus() const;
125
126 int GetCurrentMaxSpeed() const;
127 int UpdateSpeed();
128
129 protected: // These functions should not be called outside acceleration code.
130
135 inline uint16 GetPower() const
136 {
137 /* Power is not added for articulated parts */
138 if (!this->IsArticulatedPart()) {
139 /* Road vehicle power is in units of 10 HP. */
140 return 10 * GetVehicleProperty(this, PROP_ROADVEH_POWER, RoadVehInfo(this->engine_type)->power);
141 }
142 return 0;
143 }
144
149 inline uint16 GetPoweredPartPower(const RoadVehicle *head) const
150 {
151 return 0;
152 }
153
158 inline uint16 GetWeight() const
159 {
160 uint16 weight = (CargoSpec::Get(this->cargo_type)->weight * this->cargo.StoredCount()) / 16;
161
162 /* Vehicle weight is not added for articulated parts. */
163 if (!this->IsArticulatedPart()) {
164 /* Road vehicle weight is in units of 1/4 t. */
165 weight += GetVehicleProperty(this, PROP_ROADVEH_WEIGHT, RoadVehInfo(this->engine_type)->weight) / 4;
166 }
167
168 return weight;
169 }
170
175 inline byte GetTractiveEffort() const
176 {
177 /* The tractive effort coefficient is in units of 1/256. */
178 return GetVehicleProperty(this, PROP_ROADVEH_TRACTIVE_EFFORT, RoadVehInfo(this->engine_type)->tractive_effort);
179 }
180
185 inline byte GetAirDragArea() const
186 {
187 return 6;
188 }
189
194 inline byte GetAirDrag() const
195 {
196 return RoadVehInfo(this->engine_type)->air_drag;
197 }
198
203 inline AccelStatus GetAccelerationStatus() const
204 {
205 return (this->vehstatus & VS_STOPPED) ? AS_BRAKE : AS_ACCEL;
206 }
207
212 inline uint16 GetCurrentSpeed() const
213 {
214 return this->cur_speed / 2;
215 }
216
221 inline uint32 GetRollingFriction() const
222 {
223 /* Trams have a slightly greater friction coefficient than trains.
224 * The rest of road vehicles have bigger values. */
225 uint32 coeff = (this->roadtype == ROADTYPE_TRAM) ? 40 : 75;
226 /* The friction coefficient increases with speed in a way that
227 * it doubles at 128 km/h, triples at 256 km/h and so on. */
228 return coeff * (128 + this->GetCurrentSpeed()) / 128;
229 }
230
235 inline int GetAccelerationType() const
236 {
237 return 0;
238 }
239
244 inline uint32 GetSlopeSteepness() const
245 {
246 return _settings_game.vehicle.roadveh_slope_steepness;
247 }
248
253 inline uint16 GetMaxTrackSpeed() const
254 {
255 return 0;
256 }
257
262 inline bool TileMayHaveSlopedTrack() const
263 {
264 TrackStatus ts = GetTileTrackStatus(this->tile, TRANSPORT_ROAD, this->compatible_roadtypes);
265 TrackBits trackbits = TrackStatusToTrackBits(ts);
266
267 return trackbits == TRACK_BIT_X || trackbits == TRACK_BIT_Y;
268 }
269
277 inline bool HasToUseGetSlopePixelZ()
278 {
279 const RoadVehicle *rv = this->First();
280
281 /* Check if this vehicle is in the same direction as the road under.
282 * We already know it has either GVF_GOINGUP_BIT or GVF_GOINGDOWN_BIT set. */
283
284 if (rv->state <= RVSB_TRACKDIR_MASK && IsReversingRoadTrackdir((Trackdir)rv->state)) {
285 /* If the first vehicle is reversing, this vehicle may be reversing too
286 * (especially if this is the first, and maybe the only, vehicle).*/
287 return true;
288 }
289
290 while (rv != this) {
291 /* If any previous vehicle has different direction,
292 * we may be in the middle of reversing. */
293 if (this->direction != rv->direction) return true;
294 rv = rv->Next();
295 }
296
297 return false;
298 }
299 };
300
301 #define FOR_ALL_ROADVEHICLES(var) FOR_ALL_VEHICLES_OF_TYPE(RoadVehicle, var)
302
303 #endif /* ROADVEH_H */
GameSettings::vehicle
VehicleSettings vehicle
options for vehicles
Definition: settings_type.h:552
VS_STOPPED
Vehicle is stopped by the player.
Definition: vehicle_base.h:33
Vehicle::cargo
VehicleCargoList cargo
The cargo this vehicle is carrying.
Definition: vehicle_base.h:309
RoadVehicle::state
byte state
Definition: roadveh.h:89
_settings_game
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition: settings.cpp:77
road_type.h
Enums and other types related to roads.
newgrf_engine.h
Functions for NewGRF engines.
RoadVehicle::Tick
bool Tick()
Calls the tick handler of the vehicle.
Definition: roadveh_cmd.cpp:1588
CargoSpec::weight
uint8 weight
Weight of a single unit of this cargo type in 1/16 ton (62.5 kg).
Definition: cargotype.h:61
AccelStatus
AccelStatus
What is the status of our acceleration?
Definition: ground_vehicle.hpp:22
RDE_TURNED
static const uint RDE_TURNED
We just finished turning.
Definition: roadveh.h:63
Vehicle::direction
DirectionByte direction
facing
Definition: vehicle_base.h:271
IsReversingRoadTrackdir
static bool IsReversingRoadTrackdir(Trackdir dir)
Checks whether the trackdir means that we are reversing.
Definition: track_func.h:661
RoadVehicle::GetPower
uint16 GetPower() const
Allows to know the power value that this vehicle will use.
Definition: roadveh.h:135
RVSB_DRIVE_SIDE
The vehicle is at the opposite side of the road.
Definition: roadveh.h:55
RoadVehicle::GetCurrentMaxSpeed
int GetCurrentMaxSpeed() const
Calculates the maximum speed of the vehicle under its current conditions.
Definition: roadveh_cmd.cpp:437
TRACKDIR_END
Used for iterations.
Definition: track_type.h:92
RVS_IN_DT_ROAD_STOP
The vehicle is in a drive-through road stop.
Definition: roadveh.h:47
RoadVehicle::GetAccelerationStatus
AccelStatus GetAccelerationStatus() const
Checks the current acceleration status of this vehicle.
Definition: roadveh.h:203
Vehicle::cur_speed
uint16 cur_speed
current speed
Definition: vehicle_base.h:293
RoadVehicle::GetDisplayMaxSpeed
int GetDisplayMaxSpeed() const
Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
Definition: roadveh.h:113
RoadVehicle::TileMayHaveSlopedTrack
bool TileMayHaveSlopedTrack() const
Checks if the vehicle is at a tile that can be sloped.
Definition: roadveh.h:262
RoadVehicle::RoadVehicle
RoadVehicle()
We don&#39;t want GCC to zero our struct! It already is zeroed and has an index!
Definition: roadveh.h:101
RDE_NEXT_TILE
static const uint RDE_NEXT_TILE
State information about the Road Vehicle controller.
Definition: roadveh.h:62
RVS_DRIVE_SIDE
Only used when retrieving move data.
Definition: roadveh.h:45
RoadVehicle::GetExpenseType
ExpensesType GetExpenseType(bool income) const
Sets the expense type associated to this vehicle type.
Definition: roadveh.h:109
Vehicle::PreDestructor
void PreDestructor()
Destroy all stuff that (still) needs the virtual functions to work properly.
Definition: vehicle.cpp:802
RoadVehicle::GetSlopeSteepness
uint32 GetSlopeSteepness() const
Returns the slope steepness used by this vehicle.
Definition: roadveh.h:244
SpecializedVehicle< RoadVehicle, Type >::First
RoadVehicle * First() const
Get the first vehicle in the chain.
Definition: vehicle_base.h:1010
RoadType
RoadType
The different roadtypes we support.
Definition: road_type.h:22
RoadVehicle::GetMaxTrackSpeed
uint16 GetMaxTrackSpeed() const
Gets the maximum speed allowed by the track for this vehicle.
Definition: roadveh.h:253
Vehicle::vehstatus
byte vehstatus
Status.
Definition: vehicle_base.h:317
EngineImageType
EngineImageType
Visualisation contexts of vehicles and engines.
Definition: vehicle_type.h:87
VehicleCargoList::StoredCount
uint StoredCount() const
Returns sum of cargo on board the vehicle (ie not only reserved).
Definition: cargopacket.h:366
RoadVehicle::overtaking
byte overtaking
Set to RVSB_DRIVE_SIDE when overtaking, otherwise 0.
Definition: roadveh.h:92
VehicleCache::cached_max_speed
uint16 cached_max_speed
Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
Definition: vehicle_base.h:123
Direction
Direction
Defines the 8 directions on the map.
Definition: direction_type.h:26
RoadVehicleStates
RoadVehicleStates
Road vehicle states.
Definition: roadveh.h:25
TrackBits
TrackBits
Bitfield corresponding to Track.
Definition: track_type.h:41
RoadVehicle
Buses, trucks and trams belong to this class.
Definition: roadveh.h:88
RVS_IN_ROAD_STOP
The vehicle is in a road stop.
Definition: roadveh.h:46
RoadVehicle::UpdateSpeed
int UpdateSpeed()
This function looks at the vehicle and updates its speed (cur_speed and subspeed) variables...
Definition: roadveh_cmd.cpp:725
EXPENSES_ROADVEH_INC
Income from road vehicles.
Definition: economy_type.h:159
TRACK_BIT_X
X-axis track.
Definition: track_type.h:43
RoadVehicle::OnNewDay
void OnNewDay()
Calls the new day handler of the vehicle.
Definition: roadveh_cmd.cpp:1643
AS_BRAKE
We want to stop.
Definition: ground_vehicle.hpp:24
RVSB_WORMHOLE
The vehicle is in a tunnel and/or bridge.
Definition: roadveh.h:40
SpecializedVehicle::Next
T * Next() const
Get next vehicle in the chain.
Definition: vehicle_base.h:1028
PROP_ROADVEH_WEIGHT
Weight in 1/4 t.
Definition: newgrf_properties.h:38
RoadVehicle::GetAirDragArea
byte GetAirDragArea() const
Gets the area used for calculating air drag.
Definition: roadveh.h:185
RoadVehicle::GetVehicleTrackdir
Trackdir GetVehicleTrackdir() const
Returns the Trackdir on which the vehicle is currently located.
Definition: roadveh_cmd.cpp:1669
Vehicle::IsArticulatedPart
bool IsArticulatedPart() const
Check if the vehicle is an articulated part of an engine.
Definition: vehicle_base.h:891
ROADTYPE_TRAM
Trams.
Definition: road_type.h:25
Trackdir
Trackdir
Enumeration for tracks and directions.
Definition: track_type.h:74
RVS_USING_SECOND_BAY
Only used while in a road stop.
Definition: roadveh.h:43
RVSB_IN_DEPOT
The vehicle is in a depot.
Definition: roadveh.h:39
Vehicle::cargo_type
CargoID cargo_type
type of cargo this vehicle is carrying
Definition: vehicle_base.h:305
Vehicle::IsFrontEngine
bool IsFrontEngine() const
Check if the vehicle is a front engine.
Definition: vehicle_base.h:882
Vehicle::tile
TileIndex tile
Current tile index.
Definition: vehicle_base.h:230
ExpensesType
ExpensesType
Types of expenses.
Definition: economy_type.h:150
PROP_ROADVEH_POWER
Power in 10 HP.
Definition: newgrf_properties.h:37
RoadVehicle::HasToUseGetSlopePixelZ
bool HasToUseGetSlopePixelZ()
Road vehicles have to use GetSlopePixelZ() to compute their height if they are reversing because in t...
Definition: roadveh.h:277
RoadVehicle::GetPoweredPartPower
uint16 GetPoweredPartPower(const RoadVehicle *head) const
Returns a value if this articulated part is powered.
Definition: roadveh.h:149
RoadVehicle::~RoadVehicle
virtual ~RoadVehicle()
We want to &#39;destruct&#39; the right class.
Definition: roadveh.h:103
VehicleSpriteSeq
Sprite sequence for a vehicle part.
Definition: vehicle_base.h:130
RoadVehicle::Crash
uint Crash(bool flooded=false)
Crash the (whole) vehicle chain.
Definition: roadveh_cmd.cpp:530
RoadVehicle::GetTractiveEffort
byte GetTractiveEffort() const
Allows to know the tractive effort value that this vehicle will use.
Definition: roadveh.h:175
RoadVehicle::FindClosestDepot
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should...
Definition: roadveh_cmd.cpp:347
AS_ACCEL
We want to go faster, if possible of course.
Definition: ground_vehicle.hpp:23
RoadVehicle::GetDisplayImageWidth
int GetDisplayImageWidth(Point *offset=NULL) const
Get the width of a road vehicle image in the GUI.
Definition: roadveh_cmd.cpp:91
RoadVehicle::crashed_ctr
uint16 crashed_ctr
Animation counter when the vehicle has crashed.
Definition: roadveh.h:94
RoadTypes
RoadTypes
The different roadtypes we support, but then a bitmask of them.
Definition: road_type.h:36
RoadVehicle::GetAirDrag
byte GetAirDrag() const
Gets the air drag coefficient of this vehicle.
Definition: roadveh.h:194
GetTileTrackStatus
TrackStatus GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
Returns information about trackdirs and signal states.
Definition: landscape.cpp:509
RoadVehicle::IsInDepot
bool IsInDepot() const
Check whether the vehicle is in the depot.
Definition: roadveh.h:116
RoadVehicle::MarkDirty
void MarkDirty()
Marks the vehicles to be redrawn and updates cached variables.
Definition: roadveh_cmd.cpp:397
GroundVehicleCache::last_speed
uint16 last_speed
The last speed we did display, so we only have to redraw when this changes.
Definition: ground_vehicle.hpp:49
RV_OVERTAKE_TIMEOUT
static const byte RV_OVERTAKE_TIMEOUT
The number of ticks a vehicle has for overtaking.
Definition: roadveh.h:80
RVSB_IN_DT_ROAD_STOP
The vehicle is in a drive-through road stop.
Definition: roadveh.h:52
RoadVehicle::IsBus
bool IsBus() const
Check whether a roadvehicle is a bus.
Definition: roadveh_cmd.cpp:80
engine_base.h
Base class for engines.
EXPENSES_ROADVEH_RUN
Running costs road vehicles.
Definition: economy_type.h:154
RoadVehicle::GetAccelerationType
int GetAccelerationType() const
Allows to know the acceleration type of a vehicle.
Definition: roadveh.h:235
RVSB_ROAD_STOP_TRACKDIR_MASK
Only bits 0 and 3 are used to encode the trackdir for road stops.
Definition: roadveh.h:58
RoadVehUpdateCache
void RoadVehUpdateCache(RoadVehicle *v, bool same_length=false)
Update the cache of a road vehicle.
Definition: roadveh_cmd.cpp:216
RoadVehicle::GetRollingFriction
uint32 GetRollingFriction() const
Returns the rolling friction coefficient of this vehicle.
Definition: roadveh.h:221
EngineID
uint16 EngineID
Unique identification number of an engine.
Definition: engine_type.h:22
CargoSpec::Get
static CargoSpec * Get(size_t index)
Retrieve cargo details for the given cargo ID.
Definition: cargotype.h:118
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
RVS_ENTERED_STOP
Only set when a vehicle has entered the stop.
Definition: roadveh.h:44
RoadVehicle::GetRunningCost
Money GetRunningCost() const
Gets the running cost of a vehicle.
Definition: roadveh_cmd.cpp:1577
TrackStatusToTrackBits
static TrackBits TrackStatusToTrackBits(TrackStatus ts)
Returns the present-track-information of a TrackStatus.
Definition: track_func.h:351
GetRoadVehSpriteSize
void GetRoadVehSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type)
Get the size of the sprite of a road vehicle sprite heading west (used for lists).
Definition: roadveh_cmd.cpp:169
RoadVehicle::GetOrderStationLocation
TileIndex GetOrderStationLocation(StationID station)
Determine the location for the station where the vehicle goes to next.
Definition: roadveh_cmd.cpp:582
TRANSPORT_ROAD
Transport by road vehicle.
Definition: transport_type.h:30
RVSB_IN_ROAD_STOP
The vehicle is in a road stop.
Definition: roadveh.h:50
cargotype.h
Types/functions related to cargoes.
Point
Coordinates of a point in 2D.
Definition: geometry_type.hpp:28
RVSB_TRACKDIR_MASK
The mask used to extract track dirs.
Definition: roadveh.h:57
PROP_ROADVEH_TRACTIVE_EFFORT
Tractive effort coefficient in 1/256.
Definition: newgrf_properties.h:40
Vehicle::engine_type
EngineID engine_type
The type of engine used for this vehicle.
Definition: vehicle_base.h:288
RoadVehicle::UpdateDeltaXY
void UpdateDeltaXY(Direction direction)
Updates the x and y offsets and the size of the sprite used for this vehicle.
Definition: roadveh_cmd.cpp:406
VehicleSettings::roadveh_slope_steepness
uint8 roadveh_slope_steepness
Steepness of hills for road vehicles when using realistic acceleration.
Definition: settings_type.h:452
RoadVehicle::IsPrimaryVehicle
bool IsPrimaryVehicle() const
Whether this is the primary vehicle in the chain.
Definition: roadveh.h:110
track_func.h
Different conversion functions from one kind of track to another.
RoadVehicle::GetDisplaySpeed
int GetDisplaySpeed() const
Gets the speed in km-ish/h that can be sent into SetDParam for string processing. ...
Definition: roadveh.h:112
GroundVehicle
Base class for all vehicles that move through ground.
Definition: ground_vehicle.hpp:81
Vehicle::vcache
VehicleCache vcache
Cache of often used vehicle values.
Definition: vehicle_base.h:330
ground_vehicle.hpp
Base class and functions for all vehicles that move through ground.
RoadVehicle::GetImage
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
Gets the sprite to show for the given direction.
Definition: roadveh_cmd.cpp:118
OverflowSafeInt< int64, INT64_MAX, INT64_MIN >
TRACK_BIT_Y
Y-axis track.
Definition: track_type.h:44
GroundVehicle< RoadVehicle, VEH_ROAD >::gcache
GroundVehicleCache gcache
Cache of often calculated values.
Definition: ground_vehicle.hpp:82
RoadVehicle::overtaking_ctr
byte overtaking_ctr
The length of the current overtake attempt.
Definition: roadveh.h:93
RoadVehicle::GetCurrentSpeed
uint16 GetCurrentSpeed() const
Calculates the current speed of this vehicle.
Definition: roadveh.h:212
RoadVehicle::GetWeight
uint16 GetWeight() const
Allows to know the weight value that this vehicle will use.
Definition: roadveh.h:158