From 7f786ae7b8e02580ec49497f90ba340bfcb02b93 Mon Sep 17 00:00:00 2001 From: terkhen Date: Mon, 2 Aug 2010 14:52:51 +0000 Subject: [PATCH] (svn r20302) -Add: Method for getting the air drag of a ground vehicle. --- src/ground_vehicle.hpp | 1 + src/roadveh.h | 9 +++++++++ src/train.h | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index 84930464d5..2e748bda45 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -54,6 +54,7 @@ enum GroundVehicleFlags { * virtual uint16 GetPoweredPartPower(const T *head) const = 0; * virtual uint16 GetWeight() const = 0; * virtual byte GetTractiveEffort() const = 0; + * virtual byte GetAirDrag() const = 0; * virtual byte GetAirDragArea() const = 0; * virtual AccelStatus GetAccelerationStatus() const = 0; * virtual uint16 GetCurrentSpeed() const = 0; diff --git a/src/roadveh.h b/src/roadveh.h index 5a5ee549ba..9459f38161 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -219,6 +219,15 @@ protected: // These functions should not be called outside acceleration code. return 60; } + /** + * Gets the air drag coefficient of this vehicle. + * @return Air drag value from the engine. + */ + FORCEINLINE byte GetAirDrag() const + { + return RoadVehInfo(this->engine_type)->air_drag; + } + /** * Checks the current acceleration status of this vehicle. * @return Acceleration status. diff --git a/src/train.h b/src/train.h index 84bb88e30c..6cb7e5888b 100644 --- a/src/train.h +++ b/src/train.h @@ -441,6 +441,15 @@ protected: // These functions should not be called outside acceleration code. return 120; } + /** + * Gets the air drag coefficient of this vehicle. + * @return Air drag value from the engine. + */ + FORCEINLINE byte GetAirDrag() const + { + return RailVehInfo(this->engine_type)->air_drag; + } + /** * Checks the current acceleration status of this vehicle. * @return Acceleration status.