From f72ad87540a5fa575bf790bb2796c484152998b5 Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 7 Sep 2014 16:12:58 +0000 Subject: (svn r26802) -Add: Command to set visibility of an engine for a company (based on patch by Juanjo). --- src/engine_base.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/engine_base.h') 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. @@ -111,6 +112,16 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { Date GetLifeLengthInDays() const; 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. -- cgit v1.2.3-54-g00ecf