diff options
author | terkhen <terkhen@openttd.org> | 2010-12-14 21:27:30 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-12-14 21:27:30 +0000 |
commit | d6959dcc6be6a6c6cdc94c9c249a636a2781c8e5 (patch) | |
tree | 6c44d607b91a012870e842dbd219d7cfbfab4ba1 /src/engine_base.h | |
parent | 79e2b3153d4d89a653a72e07727e58300b435ac4 (diff) | |
download | openttd-d6959dcc6be6a6c6cdc94c9c249a636a2781c8e5.tar.xz |
(svn r21517) -Codechange: Add IsGroundVehicle function to the Engine class.
Diffstat (limited to 'src/engine_base.h')
-rw-r--r-- | src/engine_base.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/engine_base.h b/src/engine_base.h index ac6fa1d22..251b42729 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -87,6 +87,15 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { uint GetDisplayWeight() const; uint GetDisplayMaxTractiveEffort() const; Date GetLifeLengthInDays() const; + + /** + * Check if the engine is a ground vehicle. + * @return True iff the engine is a train or a road vehicle. + */ + FORCEINLINE bool IsGroundVehicle() const + { + return this->type == VEH_TRAIN || this->type == VEH_ROAD; + } }; struct EngineIDMapping { |