summaryrefslogtreecommitdiff
path: root/src/engine_base.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-09 16:41:36 +0000
committerfrosch <frosch@openttd.org>2011-11-09 16:41:36 +0000
commit0fbad47371a40e0619b24089ecb9261489796cda (patch)
tree21b62e8f19b633050f7d9fdf63e5100ef888f083 /src/engine_base.h
parent88b2e687c20039e13262f6194c2c7845ee21c9ef (diff)
downloadopenttd-0fbad47371a40e0619b24089ecb9261489796cda.tar.xz
(svn r23176) -Codechange: Deduplicate code between Engine::DetermineCapacity() and Engine::GetDisplayDefaultCapacity().
Diffstat (limited to 'src/engine_base.h')
-rw-r--r--src/engine_base.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/engine_base.h b/src/engine_base.h
index 9a6930868..1c798ccf1 100644
--- a/src/engine_base.h
+++ b/src/engine_base.h
@@ -86,7 +86,23 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> {
uint DetermineCapacity(const Vehicle *v, uint16 *mail_capacity = NULL) const;
bool CanCarryCargo() const;
- uint GetDisplayDefaultCapacity(uint16 *mail_capacity = NULL) const;
+
+ /**
+ * Determines the default cargo capacity of an engine for display purposes.
+ *
+ * For planes carrying both passenger and mail this is the passenger capacity.
+ * For multiheaded engines this is the capacity of both heads.
+ * For articulated engines use GetCapacityOfArticulatedParts
+ *
+ * @param mail_capacity returns secondary cargo (mail) capacity of aircraft
+ * @return The default capacity
+ * @see GetDefaultCargoType
+ */
+ uint GetDisplayDefaultCapacity(uint16 *mail_capacity = NULL) const
+ {
+ return this->DetermineCapacity(NULL, mail_capacity);
+ }
+
Money GetRunningCost() const;
Money GetCost() const;
uint GetDisplayMaxSpeed() const;