Data Structures | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Private Attributes | Friends

FINAL Struct Reference

Aircraft, helicopters, rotors and their shadows belong to this class. More...

#include <aircraft.h>

Inheritance diagram for FINAL:
SpecializedVehicle< Aircraft, VEH_AIRCRAFT > Blitter_32bppOptimized Blitter_8bppBase Blitter_8bppBase SpecializedVehicle< EffectVehicle, VEH_EFFECT > GroundVehicle< RoadVehicle, VEH_ROAD > SpecializedVehicle< Ship, VEH_SHIP > SpecializedStation< Station, false > GroundVehicle< Train, VEH_TRAIN > SpecializedVehicle< DisasterVehicle, VEH_DISASTER > SpecializedStation< Waypoint, true >

Data Structures

struct  SpriteData
 Data stored about a (single) sprite. More...

Public Member Functions

 Aircraft ()
 We don't want GCC to zero our struct! It already is zeroed and has an index!
virtual ~Aircraft ()
 We want to 'destruct' the right class.
void MarkDirty ()
 Marks the vehicles to be redrawn and updates cached variables.
void UpdateDeltaXY (Direction direction)
 Updates the x and y offsets and the size of the sprite used for this vehicle.
ExpensesType GetExpenseType (bool income) const
 Sets the expense type associated to this vehicle type.
bool IsPrimaryVehicle () const
 Whether this is the primary vehicle in the chain.
SpriteID GetImage (Direction direction, EngineImageType image_type) const
 Gets the sprite to show for the given direction.
int GetDisplaySpeed () const
 Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
int GetDisplayMaxSpeed () const
 Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
int GetSpeedOldUnits () const
Money GetRunningCost () const
 Gets the running cost of a vehicle.
bool IsInDepot () const
 Check whether the vehicle is in the depot.
bool Tick ()
 Calls the tick handler of the vehicle.
void OnNewDay ()
 Calls the new day handler of the vehicle.
uint Crash (bool flooded=false)
 Crash the (whole) vehicle chain.
TileIndex GetOrderStationLocation (StationID station)
 Determine the location for the station where the vehicle goes to next.
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 reverse.
bool IsNormalAircraft () const
 Check if the aircraft type is a normal flying device; eg not a rotor or a shadow.
uint16 GetRange () const
 Get the range of this aircraft.
 Blitter_32bppAnim ()
void Draw (Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
void DrawColourMappingRect (void *dst, int width, int height, PaletteID pal)
void SetPixel (void *video, int x, int y, uint8 colour)
void DrawRect (void *video, int width, int height, uint8 colour)
void CopyFromBuffer (void *video, const void *src, int width, int height)
void CopyToBuffer (const void *video, void *dst, int width, int height)
void ScrollBuffer (void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
int BufferSize (int width, int height)
void PaletteAnimate (const Palette &palette)
Blitter::PaletteAnimation UsePaletteAnimation ()
const char * GetName ()
int GetBytesPerPixel ()
void PostResize ()
uint32 LookupColourInPalette (uint index)
 Look up the colour in the current palette.
template<BlitterMode mode>
void Draw (const Blitter::BlitterParams *bp, ZoomLevel zoom)
void Draw (Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
SpriteEncode (SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
const char * GetName ()
void Draw (Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
SpriteEncode (SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
const char * GetName ()
 EffectVehicle ()
 We don't want GCC to zero our struct! It already is zeroed and has an index!
virtual ~EffectVehicle ()
 We want to 'destruct' the right class.
void UpdateDeltaXY (Direction direction)
 Updates the x and y offsets and the size of the sprite used for this vehicle.
bool Tick ()
 Calls the tick handler of the vehicle.
TransparencyOption GetTransparencyOption () const
 RoadVehicle ()
 We don't want GCC to zero our struct! It already is zeroed and has an index!
virtual ~RoadVehicle ()
 We want to 'destruct' the right class.
void MarkDirty ()
 Marks the vehicles to be redrawn and updates cached variables.
void UpdateDeltaXY (Direction direction)
 Updates the x and y offsets and the size of the sprite used for this vehicle.
ExpensesType GetExpenseType (bool income) const
 Sets the expense type associated to this vehicle type.
bool IsPrimaryVehicle () const
 Whether this is the primary vehicle in the chain.
SpriteID GetImage (Direction direction, EngineImageType image_type) const
 Gets the sprite to show for the given direction.
int GetDisplaySpeed () const
 Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
int GetDisplayMaxSpeed () const
 Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
Money GetRunningCost () const
 Gets the running cost of a vehicle.
int GetDisplayImageWidth (Point *offset=NULL) const
bool IsInDepot () const
 Check whether the vehicle is in the depot.
bool IsStoppedInDepot () const
 Check whether the vehicle is in the depot *and* stopped.
bool Tick ()
 Calls the tick handler of the vehicle.
void OnNewDay ()
 Calls the new day handler of the vehicle.
uint Crash (bool flooded=false)
 Crash the (whole) vehicle chain.
Trackdir GetVehicleTrackdir () const
 Returns the Trackdir on which the vehicle is currently located.
TileIndex GetOrderStationLocation (StationID station)
 Determine the location for the station where the vehicle goes to next.
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 reverse.
bool IsBus () const
int GetCurrentMaxSpeed () const
int UpdateSpeed ()
 Ship ()
 We don't want GCC to zero our struct! It already is zeroed and has an index!
virtual ~Ship ()
 We want to 'destruct' the right class.
void MarkDirty ()
 Marks the vehicles to be redrawn and updates cached variables.
void UpdateDeltaXY (Direction direction)
 Updates the x and y offsets and the size of the sprite used for this vehicle.
ExpensesType GetExpenseType (bool income) const
 Sets the expense type associated to this vehicle type.
void PlayLeaveStationSound () const
 Play the sound associated with leaving the station.
bool IsPrimaryVehicle () const
 Whether this is the primary vehicle in the chain.
SpriteID GetImage (Direction direction, EngineImageType image_type) const
 Gets the sprite to show for the given direction.
int GetDisplaySpeed () const
 Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
int GetDisplayMaxSpeed () const
 Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
Money GetRunningCost () const
 Gets the running cost of a vehicle.
bool IsInDepot () const
 Check whether the vehicle is in the depot.
bool Tick ()
 Calls the tick handler of the vehicle.
void OnNewDay ()
 Calls the new day handler of the vehicle.
Trackdir GetVehicleTrackdir () const
 Returns the Trackdir on which the vehicle is currently located.
TileIndex GetOrderStationLocation (StationID station)
 Determine the location for the station where the vehicle goes to next.
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 reverse.
void UpdateCache ()
RoadStopGetPrimaryRoadStop (RoadStopType type) const
RoadStopGetPrimaryRoadStop (const struct RoadVehicle *v) const
 Station (TileIndex tile=INVALID_TILE)
void AddFacility (StationFacility new_facility_bit, TileIndex facil_xy)
void MarkTilesDirty (bool cargo_change) const
void UpdateVirtCoord ()
uint GetPlatformLength (TileIndex tile, DiagDirection dir) const
uint GetPlatformLength (TileIndex tile) const
void RecomputeIndustriesNear ()
uint GetCatchmentRadius () const
Rect GetCatchmentRect () const
bool TileBelongsToRailStation (TileIndex tile) const
bool TileBelongsToAirport (TileIndex tile) const
uint32 GetNewGRFVariable (const ResolverObject *object, byte variable, byte parameter, bool *available) const
void GetTileArea (TileArea *ta, StationType type) const
 Train ()
 We don't want GCC to zero our struct! It already is zeroed and has an index!
virtual ~Train ()
 We want to 'destruct' the right class.
void MarkDirty ()
 Marks the vehicles to be redrawn and updates cached variables.
void UpdateDeltaXY (Direction direction)
 Updates the x and y offsets and the size of the sprite used for this vehicle.
ExpensesType GetExpenseType (bool income) const
 Sets the expense type associated to this vehicle type.
void PlayLeaveStationSound () const
 Play the sound associated with leaving the station.
bool IsPrimaryVehicle () const
 Whether this is the primary vehicle in the chain.
SpriteID GetImage (Direction direction, EngineImageType image_type) const
 Gets the sprite to show for the given direction.
int GetDisplaySpeed () const
 Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
int GetDisplayMaxSpeed () const
 Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
Money GetRunningCost () const
 Gets the running cost of a vehicle.
int GetDisplayImageWidth (Point *offset=NULL) const
bool IsInDepot () const
 Check whether the vehicle is in the depot.
bool IsStoppedInDepot () const
 Check whether the vehicle is in the depot *and* stopped.
bool Tick ()
 Calls the tick handler of the vehicle.
void OnNewDay ()
 Calls the new day handler of the vehicle.
uint Crash (bool flooded=false)
 Crash the (whole) vehicle chain.
Trackdir GetVehicleTrackdir () const
 Returns the Trackdir on which the vehicle is currently located.
TileIndex GetOrderStationLocation (StationID station)
 Determine the location for the station where the vehicle goes to next.
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 reverse.
void ReserveTrackUnderConsist () const
int GetCurveSpeedLimit () const
void ConsistChanged (bool same_length)
int UpdateSpeed ()
void UpdateAcceleration ()
int GetCurrentMaxSpeed () const
Train * GetNextUnit () const
 Get the next real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.
Train * GetPrevUnit ()
 Get the previous real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.
int CalcNextVehicleOffset () const
 Calculate the offset from this vehicle's center to the following center taking the vehicle lengths into account.
 DisasterVehicle ()
 We don't want GCC to zero our struct! It already is zeroed and has an index!
virtual ~DisasterVehicle ()
 We want to 'destruct' the right class.
void UpdateDeltaXY (Direction direction)
 Updates the x and y offsets and the size of the sprite used for this vehicle.
bool Tick ()
 Calls the tick handler of the vehicle.
 Waypoint (TileIndex tile=INVALID_TILE)
 Create a waypoint at the given tile.
void UpdateVirtCoord ()
bool TileBelongsToRailStation (TileIndex tile) const
uint32 GetNewGRFVariable (const struct ResolverObject *object, byte variable, byte parameter, bool *available) const
void GetTileArea (TileArea *ta, StationType type) const
uint GetPlatformLength (TileIndex tile, DiagDirection dir) const
uint GetPlatformLength (TileIndex tile) const
bool IsSingleTile () const
 Is this a single tile waypoint?
bool IsOfType (const Waypoint *wp) const
 Is the "type" of waypoint the same as the given waypoint, i.e.

Static Public Member Functions

static void RecomputeIndustriesNearForAll ()

Data Fields

uint16 crashed_counter
 Timer for handling crash animations.
byte pos
 Next desired position of the aircraft.
byte previous_pos
 Previous desired position of the aircraft.
StationID targetairport
 Airport to go to next.
byte state
 State of the airport.
DirectionByte last_direction
byte number_consecutive_turns
 Protection to prevent the aircraft of making a lot of turns in order to reach a specific point.
byte turn_counter
 Ticks between each turn to prevent > 45 degree turns.
byte flags
 Aircraft flags.
AircraftCache acache
uint16 animation_state
 State primarily used to change the graphics/behaviour.
byte animation_substate
 Sub state to time the change of the graphics/behaviour.
byte frame
uint16 blocked_ctr
byte overtaking
 Set to RVSB_DRIVE_SIDE when overtaking, otherwise 0.
byte overtaking_ctr
 The length of the current overtake attempt.
uint16 crashed_ctr
 Animation counter when the vehicle has crashed.
byte reverse_ctr
RoadType roadtype
RoadTypes compatible_roadtypes
TrackBitsByte state
 The "track" the ship is following.
RoadStopbus_stops
 All the road stops.
TileArea bus_station
 Tile area the bus 'station' part covers.
RoadStoptruck_stops
 All the truck stops.
TileArea truck_station
 Tile area the truck 'station' part covers.
Airport airport
 Tile area the airport covers.
TileIndex dock_tile
 The location of the dock.
IndustryType indtype
 Industry type to get the name from.
StationHadVehicleOfTypeByte had_vehicle_of_type
byte time_since_load
byte time_since_unload
byte last_vehicle_type
std::list< Vehicle * > loading_vehicles
GoodsEntry goods [NUM_CARGO]
 Goods at this station.
uint32 always_accepted
 Bitmask of always accepted cargo types (by houses, HQs, industry tiles when industry doesn't accept cargo).
IndustryVector industries_near
 Cached list of industries near the station that can accept cargo,.
TrainCache tcache
Train * other_multiheaded_part
uint16 crash_anim_pos
 Crash animation counter.
uint16 flags
TrackBitsByte track
TrainForceProceedingByte force_proceed
RailTypeByte railtype
RailTypes compatible_railtypes
uint16 wait_counter
 Ticks waiting in front of a signal, ticks being stuck or a counter for forced proceeding through signals.
SpriteID image_override
 Override for the default disaster vehicle sprite.
VehicleID big_ufo_destroyer_target
 The big UFO that this destroyer is supposed to bomb.
uint16 town_cn
 The N-1th waypoint for this town (consecutive number).

Protected Member Functions

uint16 GetPower () const
 Allows to know the power value that this vehicle will use.
uint16 GetPoweredPartPower (const RoadVehicle *head) const
 Returns a value if this articulated part is powered.
uint16 GetWeight () const
 Allows to know the weight value that this vehicle will use.
byte GetTractiveEffort () const
 Allows to know the tractive effort value that this vehicle will use.
byte GetAirDragArea () const
 Gets the area used for calculating air drag.
byte GetAirDrag () const
 Gets the air drag coefficient of this vehicle.
AccelStatus GetAccelerationStatus () const
 Checks the current acceleration status of this vehicle.
uint16 GetCurrentSpeed () const
 Calculates the current speed of this vehicle.
uint32 GetRollingFriction () const
 Returns the rolling friction coefficient of this vehicle.
int GetAccelerationType () const
 Allows to know the acceleration type of a vehicle.
uint32 GetSlopeSteepness () const
 Returns the slope steepness used by this vehicle.
uint16 GetMaxTrackSpeed () const
 Gets the maximum speed allowed by the track for this vehicle.
bool TileMayHaveSlopedTrack () const
 Checks if the vehicle is at a tile that can be sloped.
bool HasToUseGetSlopePixelZ ()
 Road vehicles have to use GetSlopePixelZ() to compute their height if they are reversing because in that case, their direction is not parallel with the road.
uint16 GetPower () const
 Allows to know the power value that this vehicle will use.
uint16 GetPoweredPartPower (const Train *head) const
 Returns a value if this articulated part is powered.
uint16 GetWeight () const
 Allows to know the weight value that this vehicle will use.
byte GetTractiveEffort () const
 Allows to know the tractive effort value that this vehicle will use.
byte GetAirDragArea () const
 Gets the area used for calculating air drag.
byte GetAirDrag () const
 Gets the air drag coefficient of this vehicle.
AccelStatus GetAccelerationStatus () const
 Checks the current acceleration status of this vehicle.
uint16 GetCurrentSpeed () const
 Calculates the current speed of this vehicle.
uint32 GetRollingFriction () const
 Returns the rolling friction coefficient of this vehicle.
int GetAccelerationType () const
 Allows to know the acceleration type of a vehicle.
uint32 GetSlopeSteepness () const
 Returns the slope steepness used by this vehicle.
uint16 GetMaxTrackSpeed () const
 Gets the maximum speed allowed by the track for this vehicle.
bool TileMayHaveSlopedTrack () const
 Checks if the vehicle is at a tile that can be sloped.
bool HasToUseGetSlopePixelZ ()
 Trains can always use the faster algorithm because they have always the same direction as the track under them.

Private Attributes

uint16 * anim_buf
 In this buffer we keep track of the 8bpp indexes so we can do palette animation.
int anim_buf_width
 The width of the animation buffer.
int anim_buf_height
 The height of the animation buffer.
Palette palette
 The current palette.

Friends

struct GroundVehicle< RoadVehicle, VEH_ROAD >
struct GroundVehicle< Train, VEH_TRAIN >

Detailed Description

Aircraft, helicopters, rotors and their shadows belong to this class.

Representation of a waypoint.

Disasters, like submarines, skyrangers and their shadows, belong to this class.

'Train' is either a loco or a wagon.

Station data structure.

All ships have this type.

Buses, trucks and trams belong to this class.

A special vehicle is one of the following:

Most trivial 8bpp blitter.

8bpp blitter optimised for speed.

The optimised 32 bpp blitter with palette animation.

Definition at line 53 of file aircraft.h.


Constructor & Destructor Documentation

virtual FINAL::~Aircraft (  )  [inline, virtual]

We want to 'destruct' the right class.

Definition at line 69 of file aircraft.h.

References Vehicle::PreDestructor().

virtual FINAL::~EffectVehicle (  )  [inline, virtual]

We want to 'destruct' the right class.

Definition at line 33 of file effectvehicle_base.h.

virtual FINAL::~RoadVehicle (  )  [inline, virtual]

We want to 'destruct' the right class.

Definition at line 102 of file roadveh.h.

References Vehicle::PreDestructor().

virtual FINAL::~Ship (  )  [inline, virtual]

We want to 'destruct' the right class.

Definition at line 30 of file ship.h.

References Vehicle::PreDestructor().

virtual FINAL::~Train (  )  [inline, virtual]

We want to 'destruct' the right class.

Definition at line 90 of file train.h.

References Vehicle::PreDestructor().

virtual FINAL::~DisasterVehicle (  )  [inline, virtual]

We want to 'destruct' the right class.

Definition at line 1022 of file vehicle_base.h.


Member Function Documentation

int FINAL::CalcNextVehicleOffset (  )  const [inline]

Calculate the offset from this vehicle's center to the following center taking the vehicle lengths into account.

Returns:
Offset from center to center.

Definition at line 153 of file train.h.

References GroundVehicleCache::cached_veh_length, GroundVehicle< T, Type >::gcache, and SpecializedVehicle< T, Type >::Next().

uint FINAL::Crash ( bool  flooded = false  )  [virtual]

Crash the (whole) vehicle chain.

Parameters:
flooded whether the cause of the crash is flooding or not.
Returns:
the number of lost souls.

Reimplemented from Vehicle.

uint FINAL::Crash ( bool  flooded = false  )  [virtual]

Crash the (whole) vehicle chain.

Parameters:
flooded whether the cause of the crash is flooding or not.
Returns:
the number of lost souls.

Reimplemented from Vehicle.

uint FINAL::Crash ( bool  flooded = false  )  [virtual]

Crash the (whole) vehicle chain.

Parameters:
flooded whether the cause of the crash is flooding or not.
Returns:
the number of lost souls.

Reimplemented from Vehicle.

bool FINAL::FindClosestDepot ( TileIndex location,
DestinationID *  destination,
bool *  reverse 
) [virtual]

Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should reverse.

Parameters:
location where do we go to?
destination what hangar do we go to?
reverse should the vehicle be reversed?
Returns:
true if a depot could be found.

Reimplemented from Vehicle.

bool FINAL::FindClosestDepot ( TileIndex location,
DestinationID *  destination,
bool *  reverse 
) [virtual]

Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should reverse.

Parameters:
location where do we go to?
destination what hangar do we go to?
reverse should the vehicle be reversed?
Returns:
true if a depot could be found.

Reimplemented from Vehicle.

bool FINAL::FindClosestDepot ( TileIndex location,
DestinationID *  destination,
bool *  reverse 
) [virtual]

Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should reverse.

Parameters:
location where do we go to?
destination what hangar do we go to?
reverse should the vehicle be reversed?
Returns:
true if a depot could be found.

Reimplemented from Vehicle.

bool FINAL::FindClosestDepot ( TileIndex location,
DestinationID *  destination,
bool *  reverse 
) [virtual]

Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should reverse.

Parameters:
location where do we go to?
destination what hangar do we go to?
reverse should the vehicle be reversed?
Returns:
true if a depot could be found.

Reimplemented from Vehicle.

AccelStatus FINAL::GetAccelerationStatus (  )  const [inline, protected]

Checks the current acceleration status of this vehicle.

Returns:
Acceleration status.

Definition at line 203 of file roadveh.h.

References AS_BRAKE, Vehicle::vehstatus, and VS_STOPPED.

AccelStatus FINAL::GetAccelerationStatus (  )  const [inline, protected]

Checks the current acceleration status of this vehicle.

Returns:
Acceleration status.

Definition at line 248 of file train.h.

References AS_BRAKE, HasBit(), Vehicle::vehstatus, VRF_TRAIN_STUCK, and VS_STOPPED.

int FINAL::GetAccelerationType (  )  const [inline, protected]

Allows to know the acceleration type of a vehicle.

Returns:
Zero, road vehicles always use a normal acceleration method.

Definition at line 235 of file roadveh.h.

int FINAL::GetAccelerationType (  )  const [inline, protected]

Allows to know the acceleration type of a vehicle.

Returns:
Acceleration type of the vehicle.

Definition at line 278 of file train.h.

References RailtypeInfo::acceleration_type, and GetRailTypeInfo().

byte FINAL::GetAirDrag (  )  const [inline, protected]

Gets the air drag coefficient of this vehicle.

Returns:
Air drag value from the engine.

Definition at line 194 of file roadveh.h.

References Vehicle::engine_type.

byte FINAL::GetAirDrag (  )  const [inline, protected]

Gets the air drag coefficient of this vehicle.

Returns:
Air drag value from the engine.

Definition at line 239 of file train.h.

References Vehicle::engine_type.

byte FINAL::GetAirDragArea (  )  const [inline, protected]

Gets the area used for calculating air drag.

Returns:
Area of the engine in m^2.

Definition at line 185 of file roadveh.h.

byte FINAL::GetAirDragArea (  )  const [inline, protected]

Gets the area used for calculating air drag.

Returns:
Area of the engine in m^2.

Definition at line 229 of file train.h.

References TRACK_BIT_WORMHOLE, Vehicle::vehstatus, and VS_HIDDEN.

uint16 FINAL::GetCurrentSpeed (  )  const [inline, protected]

Calculates the current speed of this vehicle.

Returns:
Current speed in km/h-ish.

Definition at line 212 of file roadveh.h.

References Vehicle::cur_speed.

uint16 FINAL::GetCurrentSpeed (  )  const [inline, protected]

Calculates the current speed of this vehicle.

Returns:
Current speed in km/h-ish.

Definition at line 257 of file train.h.

References Vehicle::cur_speed.

int FINAL::GetDisplayMaxSpeed (  )  const [inline, virtual]

Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's maximum speed

Reimplemented from Vehicle.

Definition at line 77 of file aircraft.h.

int FINAL::GetDisplayMaxSpeed (  )  const [inline, virtual]

Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's maximum speed

Reimplemented from Vehicle.

Definition at line 39 of file ship.h.

int FINAL::GetDisplayMaxSpeed (  )  const [inline, virtual]

Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's maximum speed

Reimplemented from Vehicle.

Definition at line 112 of file roadveh.h.

References VehicleCache::cached_max_speed, and Vehicle::vcache.

int FINAL::GetDisplayMaxSpeed (  )  const [inline, virtual]

Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's maximum speed

Reimplemented from Vehicle.

Definition at line 101 of file train.h.

References VehicleCache::cached_max_speed, and Vehicle::vcache.

int FINAL::GetDisplaySpeed (  )  const [inline, virtual]

Gets the speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's speed

Reimplemented from Vehicle.

Definition at line 38 of file ship.h.

int FINAL::GetDisplaySpeed (  )  const [inline, virtual]

Gets the speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's speed

Reimplemented from Vehicle.

Definition at line 111 of file roadveh.h.

References GroundVehicle< T, Type >::gcache, and GroundVehicleCache::last_speed.

int FINAL::GetDisplaySpeed (  )  const [inline, virtual]

Gets the speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's speed

Reimplemented from Vehicle.

Definition at line 100 of file train.h.

References GroundVehicle< T, Type >::gcache, and GroundVehicleCache::last_speed.

int FINAL::GetDisplaySpeed (  )  const [inline, virtual]

Gets the speed in km-ish/h that can be sent into SetDParam for string processing.

Returns:
the vehicle's speed

Reimplemented from Vehicle.

Definition at line 76 of file aircraft.h.

ExpensesType FINAL::GetExpenseType ( bool  income  )  const [inline, virtual]

Sets the expense type associated to this vehicle type.

Parameters:
income whether this is income or (running) expenses of the vehicle

Reimplemented from Vehicle.

Definition at line 73 of file aircraft.h.

References EXPENSES_AIRCRAFT_INC.

ExpensesType FINAL::GetExpenseType ( bool  income  )  const [inline, virtual]

Sets the expense type associated to this vehicle type.

Parameters:
income whether this is income or (running) expenses of the vehicle

Reimplemented from Vehicle.

Definition at line 34 of file ship.h.

References EXPENSES_SHIP_INC.

ExpensesType FINAL::GetExpenseType ( bool  income  )  const [inline, virtual]

Sets the expense type associated to this vehicle type.

Parameters:
income whether this is income or (running) expenses of the vehicle

Reimplemented from Vehicle.

Definition at line 108 of file roadveh.h.

References EXPENSES_ROADVEH_INC.

ExpensesType FINAL::GetExpenseType ( bool  income  )  const [inline, virtual]

Sets the expense type associated to this vehicle type.

Parameters:
income whether this is income or (running) expenses of the vehicle

Reimplemented from Vehicle.

Definition at line 96 of file train.h.

References EXPENSES_TRAIN_INC.

SpriteID FINAL::GetImage ( Direction  direction,
EngineImageType  image_type 
) const [virtual]

Gets the sprite to show for the given direction.

Parameters:
direction the direction the vehicle is facing
Returns:
the sprite for the given vehicle in the given direction

Reimplemented from Vehicle.

SpriteID FINAL::GetImage ( Direction  direction,
EngineImageType  image_type 
) const [virtual]

Gets the sprite to show for the given direction.

Parameters:
direction the direction the vehicle is facing
Returns:
the sprite for the given vehicle in the given direction

Reimplemented from Vehicle.

SpriteID FINAL::GetImage ( Direction  direction,
EngineImageType  image_type 
) const [virtual]

Gets the sprite to show for the given direction.

Parameters:
direction the direction the vehicle is facing
Returns:
the sprite for the given vehicle in the given direction

Reimplemented from Vehicle.

SpriteID FINAL::GetImage ( Direction  direction,
EngineImageType  image_type 
) const [virtual]

Gets the sprite to show for the given direction.

Parameters:
direction the direction the vehicle is facing
Returns:
the sprite for the given vehicle in the given direction

Reimplemented from Vehicle.

uint16 FINAL::GetMaxTrackSpeed (  )  const [inline, protected]

Gets the maximum speed allowed by the track for this vehicle.

Returns:
Maximum speed allowed.

Definition at line 296 of file train.h.

References GetRailType(), GetRailTypeInfo(), RailtypeInfo::max_speed, and Vehicle::tile.

uint16 FINAL::GetMaxTrackSpeed (  )  const [inline, protected]

Gets the maximum speed allowed by the track for this vehicle.

Returns:
Since roads don't limit road vehicle speed, it returns always zero.

Definition at line 253 of file roadveh.h.

Train* FINAL::GetNextUnit (  )  const [inline]

Get the next real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.

Returns:
Next vehicle in the consist.

Definition at line 129 of file train.h.

References SpecializedVehicle< T, Type >::GetNextVehicle().

TileIndex FINAL::GetOrderStationLocation ( StationID  station  )  [virtual]

Determine the location for the station where the vehicle goes to next.

Things done for example are allocating slots in a road stop or exact location of the platform is determined for ships.

Parameters:
station the station to make the next location of the vehicle.
Returns:
the location (tile) to aim for.

Reimplemented from Vehicle.

TileIndex FINAL::GetOrderStationLocation ( StationID  station  )  [virtual]

Determine the location for the station where the vehicle goes to next.

Things done for example are allocating slots in a road stop or exact location of the platform is determined for ships.

Parameters:
station the station to make the next location of the vehicle.
Returns:
the location (tile) to aim for.

Reimplemented from Vehicle.

TileIndex FINAL::GetOrderStationLocation ( StationID  station  )  [virtual]

Determine the location for the station where the vehicle goes to next.

Things done for example are allocating slots in a road stop or exact location of the platform is determined for ships.

Parameters:
station the station to make the next location of the vehicle.
Returns:
the location (tile) to aim for.

Reimplemented from Vehicle.

TileIndex FINAL::GetOrderStationLocation ( StationID  station  )  [virtual]

Determine the location for the station where the vehicle goes to next.

Things done for example are allocating slots in a road stop or exact location of the platform is determined for ships.

Parameters:
station the station to make the next location of the vehicle.
Returns:
the location (tile) to aim for.

Reimplemented from Vehicle.

uint16 FINAL::GetPower (  )  const [inline, protected]

Allows to know the power value that this vehicle will use.

Returns:
Power value from the engine in HP, or zero if the vehicle is not powered.

Definition at line 135 of file roadveh.h.

References Vehicle::engine_type, Vehicle::IsArticulatedPart(), and PROP_ROADVEH_POWER.

uint16 FINAL::GetPower (  )  const [inline, protected]

Allows to know the power value that this vehicle will use.

Returns:
Power value from the engine in HP, or zero if the vehicle is not powered.

Definition at line 168 of file train.h.

References Vehicle::engine_type, GetRailType(), HasPowerOnRail(), Vehicle::IsArticulatedPart(), GroundVehicle< T, Type >::IsMultiheaded(), PROP_TRAIN_POWER, and Vehicle::tile.

uint16 FINAL::GetPoweredPartPower ( const RoadVehicle *  head  )  const [inline, protected]

Returns a value if this articulated part is powered.

Returns:
Zero, because road vehicles don't have powered parts.

Definition at line 149 of file roadveh.h.

uint16 FINAL::GetPoweredPartPower ( const Train *  head  )  const [inline, protected]

Returns a value if this articulated part is powered.

Returns:
Power value from the articulated part in HP, or zero if it is not powered.

Definition at line 185 of file train.h.

References GroundVehicleCache::first_engine, GroundVehicle< T, Type >::gcache, GetRailType(), HasBit(), HasPowerOnRail(), Vehicle::tile, and VRF_POWEREDWAGON.

Train* FINAL::GetPrevUnit (  )  [inline]

Get the previous real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.

Returns:
Previous vehicle in the consist.

Definition at line 141 of file train.h.

References SpecializedVehicle< T, Type >::GetPrevVehicle().

uint16 FINAL::GetRange (  )  const [inline]

Get the range of this aircraft.

Returns:
Range in tiles or 0 if unlimited range.

Definition at line 105 of file aircraft.h.

uint32 FINAL::GetRollingFriction (  )  const [inline, protected]

Returns the rolling friction coefficient of this vehicle.

Returns:
Rolling friction coefficient in [1e-4].

Definition at line 266 of file train.h.

uint32 FINAL::GetRollingFriction (  )  const [inline, protected]

Returns the rolling friction coefficient of this vehicle.

Returns:
Rolling friction coefficient in [1e-4].

Definition at line 221 of file roadveh.h.

Money FINAL::GetRunningCost (  )  const [virtual]

Gets the running cost of a vehicle.

Returns:
the vehicle's running cost

Reimplemented from Vehicle.

Money FINAL::GetRunningCost (  )  const [virtual]

Gets the running cost of a vehicle.

Returns:
the vehicle's running cost

Reimplemented from Vehicle.

Money FINAL::GetRunningCost (  )  const [virtual]

Gets the running cost of a vehicle.

Returns:
the vehicle's running cost

Reimplemented from Vehicle.

Money FINAL::GetRunningCost (  )  const [virtual]

Gets the running cost of a vehicle.

Returns:
the vehicle's running cost

Reimplemented from Vehicle.

uint32 FINAL::GetSlopeSteepness (  )  const [inline, protected]

Returns the slope steepness used by this vehicle.

Returns:
Slope steepness used by the vehicle.

Definition at line 244 of file roadveh.h.

References _settings_game, VehicleSettings::roadveh_slope_steepness, and GameSettings::vehicle.

uint32 FINAL::GetSlopeSteepness (  )  const [inline, protected]

Returns the slope steepness used by this vehicle.

Returns:
Slope steepness used by the vehicle.

Definition at line 287 of file train.h.

References _settings_game, VehicleSettings::train_slope_steepness, and GameSettings::vehicle.

byte FINAL::GetTractiveEffort (  )  const [inline, protected]

Allows to know the tractive effort value that this vehicle will use.

Returns:
Tractive effort value from the engine.

Definition at line 175 of file roadveh.h.

References Vehicle::engine_type, and PROP_ROADVEH_TRACTIVE_EFFORT.

byte FINAL::GetTractiveEffort (  )  const [inline, protected]

Allows to know the tractive effort value that this vehicle will use.

Returns:
Tractive effort value from the engine.

Definition at line 220 of file train.h.

References Vehicle::engine_type, and PROP_TRAIN_TRACTIVE_EFFORT.

Trackdir FINAL::GetVehicleTrackdir (  )  const [virtual]

Returns the Trackdir on which the vehicle is currently located.

Works for trains and ships. Currently works only sortof for road vehicles, since they have a fuzzy concept of being "on" a trackdir. Dunno really what it returns for a road vehicle that is halfway a tile, never really understood that part. For road vehicles that are at the beginning or end of the tile, should just return the diagonal trackdir on which they are driving. I _think_. For other vehicles types, or vehicles with no clear trackdir (such as those in depots), returns 0xFF.

Returns:
the trackdir of the vehicle

Reimplemented from Vehicle.

Trackdir FINAL::GetVehicleTrackdir (  )  const [virtual]

Returns the Trackdir on which the vehicle is currently located.

Works for trains and ships. Currently works only sortof for road vehicles, since they have a fuzzy concept of being "on" a trackdir. Dunno really what it returns for a road vehicle that is halfway a tile, never really understood that part. For road vehicles that are at the beginning or end of the tile, should just return the diagonal trackdir on which they are driving. I _think_. For other vehicles types, or vehicles with no clear trackdir (such as those in depots), returns 0xFF.

Returns:
the trackdir of the vehicle

Reimplemented from Vehicle.

Trackdir FINAL::GetVehicleTrackdir (  )  const [virtual]

Returns the Trackdir on which the vehicle is currently located.

Works for trains and ships. Currently works only sortof for road vehicles, since they have a fuzzy concept of being "on" a trackdir. Dunno really what it returns for a road vehicle that is halfway a tile, never really understood that part. For road vehicles that are at the beginning or end of the tile, should just return the diagonal trackdir on which they are driving. I _think_. For other vehicles types, or vehicles with no clear trackdir (such as those in depots), returns 0xFF.

Returns:
the trackdir of the vehicle

Reimplemented from Vehicle.

uint16 FINAL::GetWeight (  )  const [inline, protected]

Allows to know the weight value that this vehicle will use.

Returns:
Weight value from the engine in tonnes.

Definition at line 158 of file roadveh.h.

References Vehicle::cargo, Vehicle::cargo_type, CargoList< Tinst >::Count(), Vehicle::engine_type, SpecializedVehicle< T, Type >::Get(), Vehicle::IsArticulatedPart(), and PROP_ROADVEH_WEIGHT.

uint16 FINAL::GetWeight (  )  const [inline, protected]
bool FINAL::HasToUseGetSlopePixelZ (  )  [inline, protected]

Trains can always use the faster algorithm because they have always the same direction as the track under them.

Returns:
false

Definition at line 316 of file train.h.

bool FINAL::HasToUseGetSlopePixelZ (  )  [inline, protected]

Road vehicles have to use GetSlopePixelZ() to compute their height if they are reversing because in that case, their direction is not parallel with the road.

It is safe to return true even if it is not reversing.

Returns:
are we (possibly) reversing?

Definition at line 277 of file roadveh.h.

References Vehicle::direction, SpecializedVehicle< T, Type >::First(), IsReversingRoadTrackdir(), and RVSB_TRACKDIR_MASK.

bool FINAL::IsInDepot (  )  const [virtual]

Check whether the vehicle is in the depot.

Returns:
true if and only if the vehicle is in the depot.

Reimplemented from Vehicle.

bool FINAL::IsInDepot (  )  const [inline, virtual]

Check whether the vehicle is in the depot.

Returns:
true if and only if the vehicle is in the depot.

Reimplemented from Vehicle.

Definition at line 41 of file ship.h.

bool FINAL::IsInDepot (  )  const [inline, virtual]

Check whether the vehicle is in the depot.

Returns:
true if and only if the vehicle is in the depot.

Reimplemented from Vehicle.

Definition at line 80 of file aircraft.h.

References IsHangarTile(), and VS_HIDDEN.

bool FINAL::IsInDepot (  )  const [inline, virtual]

Check whether the vehicle is in the depot.

Returns:
true if and only if the vehicle is in the depot.

Reimplemented from Vehicle.

Definition at line 115 of file roadveh.h.

bool FINAL::IsNormalAircraft (  )  const [inline]

Check if the aircraft type is a normal flying device; eg not a rotor or a shadow.

Returns:
Returns true if the aircraft is a helicopter/airplane and false if it is a shadow or a rotor

Definition at line 93 of file aircraft.h.

bool FINAL::IsOfType ( const Waypoint *  wp  )  const [inline]

Is the "type" of waypoint the same as the given waypoint, i.e.

are both a rail waypoint or are both a buoy?

Parameters:
wp The waypoint to compare to.
Returns:
true iff their types are equal.

Definition at line 64 of file waypoint_base.h.

bool FINAL::IsSingleTile (  )  const [inline]

Is this a single tile waypoint?

Returns:
true if it is.

Definition at line 53 of file waypoint_base.h.

References FACIL_TRAIN.

bool FINAL::IsStoppedInDepot (  )  const [virtual]

Check whether the vehicle is in the depot *and* stopped.

Returns:
true if and only if the vehicle is in the depot and stopped.

Reimplemented from Vehicle.

bool FINAL::IsStoppedInDepot (  )  const [virtual]

Check whether the vehicle is in the depot *and* stopped.

Returns:
true if and only if the vehicle is in the depot and stopped.

Reimplemented from Vehicle.

void FINAL::MarkDirty (  )  [virtual]

Marks the vehicles to be redrawn and updates cached variables.

This method marks the area of the vehicle on the screen as dirty. It can be use to repaint the vehicle.

Reimplemented from Vehicle.

void FINAL::MarkDirty (  )  [virtual]

Marks the vehicles to be redrawn and updates cached variables.

This method marks the area of the vehicle on the screen as dirty. It can be use to repaint the vehicle.

Reimplemented from Vehicle.

void FINAL::MarkDirty (  )  [virtual]

Marks the vehicles to be redrawn and updates cached variables.

This method marks the area of the vehicle on the screen as dirty. It can be use to repaint the vehicle.

Reimplemented from Vehicle.

void FINAL::MarkDirty (  )  [virtual]

Marks the vehicles to be redrawn and updates cached variables.

This method marks the area of the vehicle on the screen as dirty. It can be use to repaint the vehicle.

Reimplemented from Vehicle.

bool FINAL::Tick (  )  [virtual]

Calls the tick handler of the vehicle.

Returns:
is this vehicle still valid?

Reimplemented from Vehicle.

bool FINAL::Tick (  )  [virtual]

Calls the tick handler of the vehicle.

Returns:
is this vehicle still valid?

Reimplemented from Vehicle.

bool FINAL::Tick (  )  [virtual]

Calls the tick handler of the vehicle.

Returns:
is this vehicle still valid?

Reimplemented from Vehicle.

bool FINAL::Tick (  )  [virtual]

Calls the tick handler of the vehicle.

Returns:
is this vehicle still valid?

Reimplemented from Vehicle.

bool FINAL::Tick (  )  [virtual]

Calls the tick handler of the vehicle.

Returns:
is this vehicle still valid?

Reimplemented from Vehicle.

bool FINAL::Tick (  )  [virtual]

Calls the tick handler of the vehicle.

Returns:
is this vehicle still valid?

Reimplemented from Vehicle.

bool FINAL::TileMayHaveSlopedTrack (  )  const [inline, protected]

Checks if the vehicle is at a tile that can be sloped.

Returns:
True if the tile can be sloped.

Definition at line 305 of file train.h.

References TRACK_BIT_X.

bool FINAL::TileMayHaveSlopedTrack (  )  const [inline, protected]

Checks if the vehicle is at a tile that can be sloped.

Returns:
True if the tile can be sloped.

Definition at line 262 of file roadveh.h.

References GetTileTrackStatus(), Vehicle::tile, TRACK_BIT_X, TrackStatusToTrackBits(), and TRANSPORT_ROAD.

void FINAL::UpdateDeltaXY ( Direction  direction  )  [virtual]

Updates the x and y offsets and the size of the sprite used for this vehicle.

Parameters:
direction the direction the vehicle is facing

Reimplemented from Vehicle.

void FINAL::UpdateDeltaXY ( Direction  direction  )  [virtual]

Updates the x and y offsets and the size of the sprite used for this vehicle.

Parameters:
direction the direction the vehicle is facing

Reimplemented from Vehicle.

void FINAL::UpdateDeltaXY ( Direction  direction  )  [virtual]

Updates the x and y offsets and the size of the sprite used for this vehicle.

Parameters:
direction the direction the vehicle is facing

Reimplemented from Vehicle.

void FINAL::UpdateDeltaXY ( Direction  direction  )  [virtual]

Updates the x and y offsets and the size of the sprite used for this vehicle.

Parameters:
direction the direction the vehicle is facing

Reimplemented from Vehicle.

void FINAL::UpdateDeltaXY ( Direction  direction  )  [virtual]

Updates the x and y offsets and the size of the sprite used for this vehicle.

Parameters:
direction the direction the vehicle is facing

Reimplemented from Vehicle.

void FINAL::UpdateDeltaXY ( Direction  direction  )  [virtual]

Updates the x and y offsets and the size of the sprite used for this vehicle.

Parameters:
direction the direction the vehicle is facing

Reimplemented from Vehicle.

FINAL::Waypoint ( TileIndex  tile = INVALID_TILE  )  [inline]

Create a waypoint at the given tile.

Parameters:
tile The location of the waypoint.

Definition at line 25 of file waypoint_base.h.


Field Documentation

Animation counter when the vehicle has crashed.

See also:
RoadVehIsCrashed

Definition at line 93 of file roadveh.h.

Aircraft flags.

See also:
VehicleAirFlags

Definition at line 62 of file aircraft.h.

Cached list of industries near the station that can accept cargo,.

See also:
DeliverGoodsToIndustry()

Definition at line 228 of file station_base.h.

State of the airport.

See also:
AirportMovementStates
RoadVehicleStates

Definition at line 58 of file aircraft.h.

Ticks waiting in front of a signal, ticks being stuck or a counter for forced proceeding through signals.

Definition at line 85 of file train.h.


The documentation for this struct was generated from the following files: