(svn r19341) -Codechange: Move GOINGUP/GOINGDOWN flags to GroundVehicle.

-Codechange: Move GetSlopeResistance to GroundVehicle.
This commit is contained in:
terkhen
2010-03-06 12:50:55 +00:00
parent 1c3b7c35a7
commit 4e6cac84d6
7 changed files with 60 additions and 44 deletions

View File

@@ -24,10 +24,6 @@ struct Train;
enum VehicleRailFlags {
VRF_REVERSING = 0,
/* used to calculate if train is going up or down */
VRF_GOINGUP = 1,
VRF_GOINGDOWN = 2,
/* used to store if a wagon is powered or not */
VRF_POWEREDWAGON = 3,
@@ -452,25 +448,6 @@ protected: // These functions should not be called outside acceleration code.
return 35;
}
/**
* Calculates the total slope resistance for this vehicle.
* @return Slope resistance.
*/
FORCEINLINE int32 GetSlopeResistance() const
{
int32 incl = 0;
for (const Train *u = this; u != NULL; u = u->Next()) {
if (HasBit(u->flags, VRF_GOINGUP)) {
incl += u->acc_cache.cached_slope_resistance;
} else if (HasBit(u->flags, VRF_GOINGDOWN)) {
incl -= u->acc_cache.cached_slope_resistance;
}
}
return incl;
}
/**
* Allows to know the acceleration type of a vehicle.
* @return Acceleration type of the vehicle.