From 512b021e261f042dccd9bdc254cd470a46e575f5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 16 Jun 2009 13:52:18 +0000 Subject: (svn r16581) -Codechange: unify the access to Engine::lifelength. --- src/engine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/engine.cpp') diff --git a/src/engine.cpp b/src/engine.cpp index bc0fb8a52..a9ad89db5 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -315,6 +315,16 @@ uint Engine::GetDisplayMaxTractiveEffort() const } } +/** + * Returns the vehicle's life length in days. + * @return the life length + */ +Date Engine::GetLifeLengthInDays() const +{ + /* Assume leap years; this gives the player a bit more than the given amount of years, but never less. */ + return this->lifelength * DAYS_IN_LEAP_YEAR; +} + /** * Initializes the EngineOverrideManager with the default engines. */ -- cgit v1.2.3-54-g00ecf