(svn r15077) -Codechange: enumify DAYS_IN_YEAR and DAYS_IN_LEAP_YEAR

-Change: when computing daily running cost, divide by 365 (instead of 364). Since r12134, the rounding errors don't need this correction anymore
This commit is contained in:
smatz
2009-01-13 22:58:03 +00:00
parent cb221d9996
commit e00cf92f47
20 changed files with 55 additions and 47 deletions

View File

@@ -186,7 +186,7 @@
{
if (!IsValidEngine(engine_id)) return -1;
return ::GetEngine(engine_id)->lifelength * 366;
return ::GetEngine(engine_id)->lifelength * DAYS_IN_LEAP_YEAR;
}
/* static */ Money AIEngine::GetRunningCost(EngineID engine_id)

View File

@@ -117,7 +117,7 @@ public:
* @param engine_id The engine to get the running cost of.
* @pre IsValidEngine(engine_id).
* @return The running cost of a vehicle per year.
* @note Cost is per year; divide by 364 to get per day.
* @note Cost is per year; divide by 365 to get per day.
*/
static Money GetRunningCost(EngineID engine_id);

View File

@@ -286,7 +286,7 @@ public:
/**
* Get the running cost of the offered engine.
* @return The running cost of the vehicle per year.
* @note Cost is per year; divide by 364 to get per day.
* @note Cost is per year; divide by 365 to get per day.
*/
Money GetRunningCost();

View File

@@ -218,7 +218,7 @@ public:
* @param vehicle_id The vehicle to get the age of.
* @pre IsValidVehicle(vehicle_id).
* @return The running cost of the vehicle per year.
* @note Cost is per year; divide by 364 to get per day.
* @note Cost is per year; divide by 365 to get per day.
* @note This is not equal to AIEngine::GetRunningCost for Trains, because
* wagons and second engines can add up in the calculation too.
*/