(svn r26802) -Add: Command to set visibility of an engine for a company (based on patch by Juanjo).

This commit is contained in:
alberth
2014-09-07 16:12:58 +00:00
parent eb41511cd1
commit f72ad87540
7 changed files with 57 additions and 1 deletions

View File

@@ -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.