diff options
Diffstat (limited to 'src/engine_base.h')
-rw-r--r-- | src/engine_base.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/engine_base.h b/src/engine_base.h index 99a15aaea..6a2e6816c 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -37,6 +37,7 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { CompanyByte preview_company;///< Company which is currently being offered a preview \c INVALID_COMPANY means no company. byte preview_wait; ///< Daily countdown timer for timeout of offering the engine to the #preview_company company. CompanyMask company_avail; ///< Bit for each company whether the engine is available for that company. + CompanyMask company_hidden; ///< Bit for each company whether the engine is normally hidden in the build gui for that company. uint8 original_image_index; ///< Original vehicle image index, thus the image index of the overridden vehicle VehicleType type; ///< %Vehicle type, ie #VEH_ROAD, #VEH_TRAIN, etc. @@ -112,6 +113,16 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { uint16 GetRange() const; /** + * Check whether the engine is hidden in the GUI for the given company. + * @param c Company to check. + * @return \c true iff the engine is hidden in the GUI for the given company. + */ + inline bool IsHidden(CompanyByte c) const + { + return c < MAX_COMPANIES && HasBit(this->company_hidden, c); + } + + /** * Check if the engine is a ground vehicle. * @return True iff the engine is a train or a road vehicle. */ |