diff --git a/src/aircraft.h b/src/aircraft.h index 3a7a99a2de..9acc5b672c 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -44,6 +44,8 @@ enum class VehicleAirFlag : uint8_t { HelicopterDirectDescent = 3, ///< The helicopter is descending directly at its destination (helipad or in front of hangar) }; + +/** Bitset of \c VehicleAirFlag elements. */ using VehicleAirFlags = EnumBitSet; static const int ROTOR_Z_OFFSET = 5; ///< Z Offset between helicopter- and rotorsprite. diff --git a/src/airport.h b/src/airport.h index 3b231dc286..11e2c34be3 100644 --- a/src/airport.h +++ b/src/airport.h @@ -56,6 +56,7 @@ enum class AirportMovingDataFlag : uint8_t { Hold, ///< Holding pattern movement (above the airport). }; +/** Bitset of \c AirportMovingDataFlag elements. */ using AirportMovingDataFlags = EnumBitSet; /** Movement States on Airports (headings target) */ @@ -129,6 +130,8 @@ enum class AirportBlock : uint8_t { Zeppeliner = 62, ///< Block for the zeppeliner disaster vehicle. AirportClosed = 63, ///< Dummy block for indicating a closed airport. }; + +/** Bitset of \c AirportBlock elements. */ using AirportBlocks = EnumBitSet; /** A single location on an airport where aircraft can move to. */ @@ -163,6 +166,8 @@ public: Helicopters = 1, ///< Can helicopters land on this airport type? ShortStrip = 2, ///< This airport has a short landing strip, dangerous for fast aircraft. }; + + /** Bitset of \c Flag elements. */ using Flags = EnumBitSet; AirportFTAClass( diff --git a/src/base_consist.h b/src/base_consist.h index aefa55c5c6..a1997fed8f 100644 --- a/src/base_consist.h +++ b/src/base_consist.h @@ -28,6 +28,8 @@ enum class VehicleFlag : uint8_t { ServiceIntervalIsPercent = 9, ///< Service interval is percent. DrivingBackwards = 10, ///< Vehicle is driving backwards. }; + +/** Bitset of \c VehicleFlag elements. */ using VehicleFlags = EnumBitSet; /** Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. */ diff --git a/src/blitter/32bpp_sse2.hpp b/src/blitter/32bpp_sse2.hpp index 93d1c7c438..679982aa0e 100644 --- a/src/blitter/32bpp_sse2.hpp +++ b/src/blitter/32bpp_sse2.hpp @@ -63,6 +63,7 @@ public: NoAnim, ///< The sprite has no palette animated pixel. }; + /** Bitset of \c SpriteFlag elements. */ using SpriteFlags = EnumBitSet; /** Data stored about a (single) sprite. */ diff --git a/src/bridge.h b/src/bridge.h index cae5ab072e..d32ea5b85d 100644 --- a/src/bridge.h +++ b/src/bridge.h @@ -30,6 +30,8 @@ struct BridgeSpec { CustomPillarFlags, ///< Bridge has set custom pillar flags. InvalidPillarFlags, ///< Bridge pillar flags are not valid, i.e. only the tile layout has been modified. }; + + /** Bitset of \c ControlFlag elements. */ using ControlFlags = EnumBitSet; TimerGameCalendar::Year avail_year; ///< the year where it becomes available diff --git a/src/bridge_type.h b/src/bridge_type.h index e0996dc001..2665d556a4 100644 --- a/src/bridge_type.h +++ b/src/bridge_type.h @@ -48,6 +48,8 @@ enum class BridgePillarFlag : uint8_t { EdgeSW = 6, ///< Southwest edge is obstructed. EdgeNW = 7, ///< Northwest edge is obstructed. }; + +/** Bitset of \c BridgePillarFlag elements. */ using BridgePillarFlags = EnumBitSet; static constexpr BridgePillarFlags BRIDGEPILLARFLAGS_ALL{ diff --git a/src/cargo_type.h b/src/cargo_type.h index b009480229..a9daeef56b 100644 --- a/src/cargo_type.h +++ b/src/cargo_type.h @@ -109,6 +109,7 @@ namespace CargoFilterCriteria { */ inline bool IsValidCargoType(CargoType cargo) { return cargo != INVALID_CARGO; } +/** Bitset of \c CargoType elements. */ using CargoTypes = EnumBitSet; static constexpr CargoTypes ALL_CARGOTYPES{UINT64_MAX}; diff --git a/src/cargotype.h b/src/cargotype.h index 54e7f2a1ca..a7cddef94c 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -65,6 +65,8 @@ enum class CargoClass : uint8_t { NonPotable = 14, ///< Non-potable / non-food / dirty. Special = 15, ///< Special bit used for livery refit tricks instead of normal cargoes. }; + +/** Bitset of \c CargoClass elements. */ using CargoClasses = EnumBitSet; static const uint8_t INVALID_CARGO_BITNUM = 0xFF; ///< Constant representing invalid cargo diff --git a/src/command_type.h b/src/command_type.h index a39cc1da50..bd96b2b03c 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -401,6 +401,8 @@ enum class DoCommandFlag : uint8_t { NoModifyTownRating, ///< do not change town rating ForceClearTile, ///< do not only remove the object on the tile, but also clear any water left on it }; + +/** Bitset of \c DoCommandFlag elements. */ using DoCommandFlags = EnumBitSet; /** @@ -422,6 +424,8 @@ enum class CommandFlag : uint8_t { NoEst, ///< the command is never estimated. Location, ///< the command has implicit location argument. }; + +/** Bitset of \c CommandFlag elements. */ using CommandFlags = EnumBitSet; /** Types of commands we have. */ diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 32db83dd40..2e70d0ddd2 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -19,7 +19,10 @@ enum class PoolType : uint8_t { NetworkAdmin, ///< Network admin pool. Data, ///< NewGRF or other data, that is not reset together with normal pools. }; + +/** Bitset of \c PoolType elements. */ using PoolTypes = EnumBitSet; + static constexpr PoolTypes PT_ALL = {PoolType::Normal, PoolType::NetworkClient, PoolType::NetworkAdmin, PoolType::Data}; typedef std::vector PoolVector; ///< Vector of pointers to PoolBase diff --git a/src/direction_type.h b/src/direction_type.h index f8e8f3e98b..7ac0e1ddfd 100644 --- a/src/direction_type.h +++ b/src/direction_type.h @@ -38,6 +38,7 @@ enum class Direction : uint8_t { /** Allow incrementing of Direction variables */ DECLARE_INCREMENT_DECREMENT_OPERATORS(Direction) +/** Bitset of \c Direction elements. */ using Directions = EnumBitSet; /** All possible directions. */ diff --git a/src/dropdown_type.h b/src/dropdown_type.h index 3ebd4e01fc..e590e54d93 100644 --- a/src/dropdown_type.h +++ b/src/dropdown_type.h @@ -102,6 +102,8 @@ enum class DropDownOption : uint8_t { Persist, ///< Set if this dropdown should stay open after an option is selected. Filterable, ///< Set if the dropdown is filterable. }; + +/** Bitset of \c DropDownOption elements. */ using DropDownOptions = EnumBitSet; void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, WidgetID button, Rect wi_rect, Colours wi_colour, DropDownOptions options = {}, std::string * const persistent_filter_text = nullptr); diff --git a/src/engine_base.h b/src/engine_base.h index 87975b35b1..fc6fb9fab9 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -30,6 +30,7 @@ enum class EngineDisplayFlag : uint8_t { Shaded, ///< Set if engine should be masked. }; +/** Bitset of \c EngineDisplayFlag elements. */ using EngineDisplayFlags = EnumBitSet; typedef Pool EnginePool; diff --git a/src/engine_type.h b/src/engine_type.h index 54af76069f..56102e028e 100644 --- a/src/engine_type.h +++ b/src/engine_type.h @@ -176,6 +176,8 @@ enum class ExtraEngineFlag : uint8_t { SyncReliability = 3, ///< Engine reliability will be synced with variant parent. HasCab = 4, ///< Train wagon has a cab and can lead a train when backing up, without any speed reduction. }; + +/** Bitset of \c ExtraEngineFlag elements. */ using ExtraEngineFlags = EnumBitSet; /** @@ -195,6 +197,8 @@ enum class EngineMiscFlag : uint8_t { NoBreakdownSmoke = 6, ///< Do not show black smoke during a breakdown. SpriteStack = 7, ///< Draw vehicle by stacking multiple sprites. }; + +/** Bitset of \c EngineMiscFlag elements. */ using EngineMiscFlags = EnumBitSet; /** @@ -228,6 +232,8 @@ enum class EngineFlag : uint8_t { Available = 0, ///< This vehicle is available to everyone. ExclusivePreview = 1, ///< This vehicle is in the exclusive preview stage, either being used or being offered to a company. }; + +/** Bitset of \c EngineFlag elements. */ using EngineFlags = EnumBitSet; /** diff --git a/src/fileio_func.h b/src/fileio_func.h index 264bb9677d..5caff43fba 100644 --- a/src/fileio_func.h +++ b/src/fileio_func.h @@ -67,6 +67,8 @@ public: Scenario, ///< Scan for scenarios and heightmaps. Game, ///< Scan for game scripts. }; + + /** Bitset of \c Mode elements. */ using Modes = EnumBitSet; static constexpr Modes MODES_ALL = {Mode::Baseset, Mode::NewGRF, Mode::AI, Mode::Scenario, Mode::Game}; ///< Scan for everything. diff --git a/src/gfx_type.h b/src/gfx_type.h index a3b42b1f56..1d3fbdf6b2 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -256,6 +256,7 @@ enum class FontSize : uint8_t { }; DECLARE_INCREMENT_DECREMENT_OPERATORS(FontSize) +/** Bitset of \c FontSize elements. */ using FontSizes = EnumBitSet; /** Mask of all possible font sizes. */ @@ -342,6 +343,7 @@ enum class ExtendedTextColourFlag : uint8_t{ NoShade, ///< Do not add shading to this text colour. Forced, ///< Ignore colour changes from strings. }; + using ExtendedTextColourFlags = EnumBitSet; ///< Bitset of the flags of ExtendedTextColour. */ /** Container for the text colour and some text colour related flags for drawing. */ diff --git a/src/group.h b/src/group.h index 852f81ad7c..af334a4495 100644 --- a/src/group.h +++ b/src/group.h @@ -68,6 +68,8 @@ enum class GroupFlag : uint8_t { ReplaceProtection = 0, ///< If set, the global autoreplace has no effect on the group ReplaceWagonRemoval = 1, ///< If set, autoreplace will perform wagon removal on vehicles in this group. }; + +/** Bitset of \c GroupFlag elements. */ using GroupFlags = EnumBitSet; /** Group data. */ diff --git a/src/house.h b/src/house.h index e41e1db53f..9bb5252ebf 100644 --- a/src/house.h +++ b/src/house.h @@ -45,6 +45,8 @@ enum class BuildingFlag : uint8_t { IsChurch = 6, ///< The building functions as a church, i.e. only one can be built in a town. IsStadium = 7, ///< The building functions as a stadium, i.e. only one can be built in a town. }; + +/** Bitset of \c BuildingFlag elements. */ using BuildingFlags = EnumBitSet; static constexpr BuildingFlags BUILDING_HAS_1_TILE = {BuildingFlag::Size1x1, BuildingFlag::Size2x1, BuildingFlag::Size1x2, BuildingFlag::Size2x2}; @@ -68,6 +70,8 @@ enum class HouseZone : uint8_t { ClimateSubtropic = 14, ///< Building can appear in subtropical climate ClimateToyland = 15, ///< Building can appear in toyland climate }; + +/** Bitset of \c HouseZone elements. */ using HouseZones = EnumBitSet; static constexpr uint NUM_HOUSE_ZONES = to_underlying(HouseZone::TownEnd); @@ -95,6 +99,8 @@ enum class HouseExtraFlag : uint8_t { SynchronisedCallback1B = 2, ///< synchronized callback 1B will be performed, on multi tile houses Callback1ARandomBits = 3, ///< callback 1A needs random bits }; + +/** Bitset of \c HouseExtraFlag elements. */ using HouseExtraFlags = EnumBitSet; struct HouseSpec { diff --git a/src/house_type.h b/src/house_type.h index 7fb0b449fa..de83e1d92b 100644 --- a/src/house_type.h +++ b/src/house_type.h @@ -27,6 +27,8 @@ enum class HouseRandomTrigger : uint8_t { */ TileLoopNorth, }; + +/** Bitset of \c HouseRandomTrigger elements. */ using HouseRandomTriggers = EnumBitSet; #endif /* HOUSE_TYPE_H */ diff --git a/src/industry.h b/src/industry.h index e5e290923b..ac80820dff 100644 --- a/src/industry.h +++ b/src/industry.h @@ -54,6 +54,8 @@ enum class IndustryControlFlag : uint8_t { ExternalProdLevel = 3, End, ///< End marker. }; + +/** Bitset of \c IndustryControlFlag elements. */ using IndustryControlFlags = EnumBitSet; /** diff --git a/src/industry_type.h b/src/industry_type.h index a563d6f5d4..9c1908b192 100644 --- a/src/industry_type.h +++ b/src/industry_type.h @@ -27,6 +27,8 @@ enum class IndustryRandomTrigger : uint8_t { IndustryTick, ///< The industry has been triggered via its tick. CargoReceived, ///< Cargo has been delivered. }; + +/** Bitset of \c IndustryRandomTrigger elements. */ using IndustryRandomTriggers = EnumBitSet; /** Animation triggers of the industries. */ @@ -37,6 +39,8 @@ enum class IndustryAnimationTrigger : uint8_t { CargoReceived, ///< Trigger when cargo is received . CargoDistributed, ///< Trigger when cargo is distributed. }; + +/** Bitset of \c IndustryAnimationTrigger elements. */ using IndustryAnimationTriggers = EnumBitSet; static const IndustryType NUM_INDUSTRYTYPES_PER_GRF = 128; ///< maximum number of industry types per NewGRF; limited to 128 because bit 7 has a special meaning in some variables/callbacks (see MapNewGRFIndustryType). diff --git a/src/industrytype.h b/src/industrytype.h index 87021da477..b091b83372 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -26,6 +26,8 @@ enum class IndustryLifeType : uint8_t { Organic = 1, ///< Like forests Processing = 2, ///< Like factories }; + +/** Bitset of \c IndustryLifeType elements. */ using IndustryLifeTypes = EnumBitSet; static constexpr IndustryLifeTypes INDUSTRYLIFE_BLACK_HOLE{}; ///< Like power plants and banks @@ -79,6 +81,8 @@ enum class IndustryBehaviour : uint8_t { CargoTypesUnlimited = 18, ///< Allow produced/accepted cargoes callbacks to supply more than 2 and 3 types NoPaxProdClamp = 19, ///< Do not clamp production of passengers. (smooth economy only) }; + +/** Bitset of \c IndustryBehaviour elements. */ using IndustryBehaviours = EnumBitSet; /** Flags for miscellaneous industry tile specialities */ @@ -86,6 +90,8 @@ enum class IndustryTileSpecialFlag : uint8_t { NextFrameRandomBits = 0, ///< Callback 0x26 needs random bits AcceptsAllCargo = 1, ///< Tile always accepts all cargoes the associated industry accepts }; + +/** Bitset of \c IndustryTileSpecialFlag elements. */ using IndustryTileSpecialFlags = EnumBitSet; /** Definition of one tile in an industry tile layout */ diff --git a/src/landscape_type.h b/src/landscape_type.h index d9091c9992..5dfb26790c 100644 --- a/src/landscape_type.h +++ b/src/landscape_type.h @@ -19,6 +19,8 @@ enum class LandscapeType : uint8_t { Tropic = 2, ///< Landscape with distinct rainforests and deserts, Toyland = 3, ///< Landscape with funky industries and vehicles. }; + +/** Bitset of \c LandscapeType elements. */ using LandscapeTypes = EnumBitSet; static constexpr uint NUM_LANDSCAPE = 4; @@ -33,6 +35,8 @@ enum class BorderFlag : uint8_t { NorthWest, ///< Border on North West. Random, ///< Randomise borders. }; + +/** Bitset of \c BorderFlag elements. */ using BorderFlags = EnumBitSet; static constexpr BorderFlags BORDERFLAGS_ALL = BorderFlags{BorderFlag::NorthEast, BorderFlag::SouthEast, BorderFlag::SouthWest, BorderFlag::NorthWest}; ///< Border on all sides. diff --git a/src/linkgraph/linkgraph_type.h b/src/linkgraph/linkgraph_type.h index f9a8888a5e..9a5d428a37 100644 --- a/src/linkgraph/linkgraph_type.h +++ b/src/linkgraph/linkgraph_type.h @@ -50,6 +50,7 @@ enum class EdgeUpdateMode : uint8_t { Unrestricted, ///< Use unrestricted link. }; +/** Bitset of \c EdgeUpdateMode elements. */ using EdgeUpdateModes = EnumBitSet; #endif /* LINKGRAPH_TYPE_H */ diff --git a/src/linkgraph/refresh.h b/src/linkgraph/refresh.h index bd357889aa..ac414f7b1f 100644 --- a/src/linkgraph/refresh.h +++ b/src/linkgraph/refresh.h @@ -33,6 +33,7 @@ protected: InAutorefit, ///< Currently doing an autorefit loop. Ignore the first autorefit order. }; + /** Bitset of \c RefreshFlag elements. */ using RefreshFlags = EnumBitSet; /** diff --git a/src/livery.h b/src/livery.h index df1749aa0d..d217967977 100644 --- a/src/livery.h +++ b/src/livery.h @@ -86,6 +86,8 @@ struct Livery { Primary = 0, ///< Primary colour is set. Secondary = 1, ///< Secondary colour is set. }; + + /** Bitset of \c Flag elements. */ using Flags = EnumBitSet; Flags in_use{}; ///< Livery flags. diff --git a/src/newgrf.h b/src/newgrf.h index 0f6383c2c0..1c76a98311 100644 --- a/src/newgrf.h +++ b/src/newgrf.h @@ -75,6 +75,7 @@ enum class GrfMiscBit : uint8_t { SecondRockyTileSet = 6, ///< Enable using the second rocky tile set. }; +/** Bitset of \c GrfMiscBit elements. */ using GrfMiscBits = EnumBitSet; enum class GrfSpecFeature : uint8_t { @@ -110,6 +111,8 @@ enum class GrfSpecFeature : uint8_t { Invalid = 0xFF, ///< An invalid spec feature }; + +/** Bitset of \c GrfSpecFeature elements. */ using GrfSpecFeatures = EnumBitSet; static const uint32_t INVALID_GRFID = 0xFFFFFFFF; diff --git a/src/newgrf_badge_type.h b/src/newgrf_badge_type.h index e81fb6d595..2cd10a2a30 100644 --- a/src/newgrf_badge_type.h +++ b/src/newgrf_badge_type.h @@ -33,6 +33,8 @@ enum class BadgeFlag : uint8_t { HasText, ///< Internal flag set if the badge has text. }; + +/** Bitset of \c BridgeFlag elements. */ using BadgeFlags = EnumBitSet; using BadgeFilterChoices = std::unordered_map; diff --git a/src/newgrf_callbacks.h b/src/newgrf_callbacks.h index cbdece5f98..ccbcd2f5bd 100644 --- a/src/newgrf_callbacks.h +++ b/src/newgrf_callbacks.h @@ -311,6 +311,8 @@ enum class VehicleCallbackMask : uint8_t { Name = 8, ///< Engine name CustomRefit = 9, ///< Custom refit mask }; + +/** Bitset of \c VehicleCallbackMask elements. */ using VehicleCallbackMasks = EnumBitSet; /** @@ -323,6 +325,8 @@ enum class StationCallbackMask : uint8_t { AnimationSpeed = 3, ///< Customize the animation speed of the station SlopeCheck = 4, ///< Check slope of new station tiles }; + +/** Bitset of \c StationCallbackMask elements. */ using StationCallbackMasks = EnumBitSet; /** @@ -333,6 +337,8 @@ enum class RoadStopCallbackMask : uint8_t { AnimationNextFrame = 1, ///< Use a custom next frame callback AnimationSpeed = 2, ///< Customize the animation speed of the road stop }; + +/** Bitset of \c RoadStopCallbackMask elements. */ using RoadStopCallbackMasks = EnumBitSet; /** @@ -353,6 +359,8 @@ enum class HouseCallbackMask : uint8_t { DrawFoundations = 11, ///< decides if default foundations need to be drawn Autoslope = 12, ///< decides allowance of autosloping }; + +/** Bitset of \c HouseCallbackMask elements. */ using HouseCallbackMasks = EnumBitSet; /** @@ -361,6 +369,8 @@ using HouseCallbackMasks = EnumBitSet; enum class CanalCallbackMask : uint8_t { SpriteOffset = 0, ///< Enable add sprite offset callback }; + +/** Bitset of \c CanalCallbackMask elements. */ using CanalCallbackMasks = EnumBitSet; /** @@ -370,6 +380,8 @@ enum class CargoCallbackMask : uint8_t { ProfitCalc = 0, ///< custom profit calculation StationRatingCalc = 1, ///< custom station rating for this cargo type }; + +/** Bitset of \c CargoCallbackMask elements. */ using CargoCallbackMasks = EnumBitSet; /** @@ -392,6 +404,8 @@ enum class IndustryCallbackMask : uint8_t { OutputCargoTypes = 13, ///< customize the cargoes the industry produces ProdChangeBuild = 14, ///< initialise production level on construction }; + +/** Bitset of \c IndustryCallbackMask elements. */ using IndustryCallbackMasks = EnumBitSet; /** @@ -406,6 +420,8 @@ enum class IndustryTileCallbackMask : uint8_t { DrawFoundations = 5, ///< decides if default foundations need to be drawn Autoslope = 6, ///< decides allowance of autosloping }; + +/** Bitset of \c IndustryTileCallbackMask elements. */ using IndustryTileCallbackMasks = EnumBitSet; /** @@ -419,6 +435,8 @@ enum class ObjectCallbackMask : uint8_t { FundMoreText = 4, ///< additional text in fund window Autoslope = 5, ///< decides allowance of autosloping }; + +/** Bitset of \c ObjectCallbackMask elements. */ using ObjectCallbackMasks = EnumBitSet; /** @@ -431,6 +449,8 @@ enum class AirportTileCallbackMask : uint8_t { DrawFoundations = 5, ///< decides if default foundations need to be drawn Autoslope = 6, ///< decides allowance of autosloping }; + +/** Bitset of \c AirportTileCallbackMask elements. */ using AirportTileCallbackMasks = EnumBitSet; /** diff --git a/src/newgrf_config.h b/src/newgrf_config.h index 407310a75e..cab856b2c6 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -27,6 +27,8 @@ enum class GRFConfigFlag : uint8_t { Reserved, ///< GRF file passed GrfLoadingStage::Reserve stage Invalid, ///< GRF is unusable with this version of OpenTTD }; + +/** Bitset of \c GRFConfigFlag elements. */ using GRFConfigFlags = EnumBitSet; /** Status of GRF */ @@ -46,6 +48,8 @@ enum class GRFBug : uint8_t { UnknownCbResult = 3, ///< A callback returned an unknown/invalid result VehCapacity = 4, ///< Capacity of vehicle changes when not refitting or arranging }; + +/** Bitset of \c GRFBug elements. */ using GRFBugs = EnumBitSet; /** Status of post-gameload GRF compatibility check */ diff --git a/src/newgrf_object.h b/src/newgrf_object.h index 040dc5c581..5c6bb101ea 100644 --- a/src/newgrf_object.h +++ b/src/newgrf_object.h @@ -39,6 +39,8 @@ enum class ObjectFlag : uint8_t { AnimRandomBits = 12, ///< Object wants random bits in "next animation frame" callback. ScaleByWater = 13, ///< Object count is roughly scaled by water amount at edges. }; + +/** Bitset of \c ObjectFlag elements. */ using ObjectFlags = EnumBitSet; static const uint8_t OBJECT_SIZE_1X1 = 0x11; ///< The value of a NewGRF's size property when the object is 1x1 tiles: low nibble for X, high nibble for Y. diff --git a/src/newgrf_roadstop.h b/src/newgrf_roadstop.h index 2a57f65a64..9e9631dd4b 100644 --- a/src/newgrf_roadstop.h +++ b/src/newgrf_roadstop.h @@ -55,6 +55,8 @@ enum class RoadStopDrawMode : uint8_t { Overlay = 1, ///< Drive-through stops: Draw the road overlay, e.g. pavement WaypGround = 2, ///< Waypoints: Draw the sprite layout ground tile (on top of the road) }; + +/** Bitset of \c RoadStopDrawMode elements. */ using RoadStopDrawModes = EnumBitSet; enum class RoadStopSpecFlag : uint8_t { @@ -66,6 +68,8 @@ enum class RoadStopSpecFlag : uint8_t { TramOnly = 6, ///< Only show in the tram build menu (not road). DrawModeRegister = 8, ///< Read draw mode from register 0x100. }; + +/** Bitset of \c RoadStopSpecFlag elements. */ using RoadStopSpecFlags = EnumBitSet; enum RoadStopView : uint8_t { diff --git a/src/newgrf_station.h b/src/newgrf_station.h index f610cfec8f..32fffc0022 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -116,6 +116,8 @@ enum class StationSpecFlag : uint8_t { ExtendedFoundations = 4, ///< Extended foundation block instead of simple. DivByStationArea = 5, ///< Divide cargo amount by station area. }; + +/** Bitset of \c StationSpecFlag elements. */ using StationSpecFlags = EnumBitSet; /** Station specification. */ @@ -168,7 +170,10 @@ struct StationSpec : NewGRFSpecBase { NoWires = 1, ///< Tile should NOT contain catenary wires. Blocked = 2, ///< Tile is blocked to vehicles. }; + + /** Bitset of \c TileFlag elements. */ using TileFlags = EnumBitSet; + std::vector tileflags; ///< List of tile flags. std::vector bridgeable_info; ///< Per tile layout bridge information. diff --git a/src/news_type.h b/src/news_type.h index 0c4d36db5f..dc724f2abf 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -92,6 +92,8 @@ enum class NewsFlag : uint8_t { Shaded, ///< News item uses shaded colours. VehicleParam0, ///< String param 0 contains a vehicle ID. (special autoreplace behaviour) }; + +/** Bitset of \c NewsFlag elements. */ using NewsFlags = EnumBitSet; /** diff --git a/src/object_type.h b/src/object_type.h index ed011b2407..136814dc3a 100644 --- a/src/object_type.h +++ b/src/object_type.h @@ -38,6 +38,8 @@ enum class ObjectAnimationTrigger : uint8_t { TileLoop, ///< Triggered in the periodic tile loop. TileLoopNorth, ///< Triggered every 256 ticks (for all tiles at the same time). }; + +/** Bitset of \c ObjectAnimationTrigger elements. */ using ObjectAnimationTriggers = EnumBitSet; #endif /* OBJECT_TYPE_H */ diff --git a/src/openttd.h b/src/openttd.h index 95425775f7..084d3719d2 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -78,6 +78,8 @@ enum class PauseMode : uint8_t { LinkGraph = 6, ///< A game paused due to the link graph schedule lagging CommandDuringPause = 7, ///< A game paused, and a command executed during the pause; resets on autosave }; + +/** Bitset of \c PauseMode elements. */ using PauseModes = EnumBitSet; /** The current pause mode */ diff --git a/src/order_type.h b/src/order_type.h index 42c99a9477..06d0c32f31 100644 --- a/src/order_type.h +++ b/src/order_type.h @@ -89,6 +89,7 @@ enum class OrderNonStopFlag : uint8_t { GoVia = 1, ///< The vehicle will stop at any station it passes except the destination, aka via. }; +/** Bitset of \c OrderNonStopFlag elements. */ using OrderNonStopFlags = EnumBitSet; /** @@ -109,6 +110,7 @@ enum class OrderDepotTypeFlag : uint8_t { PartOfOrders = 1, ///< This depot order is because of a regular order. }; +/** Bitset of \c OrderDepotTypeFlag elements. */ using OrderDepotTypeFlags = EnumBitSet; /** @@ -120,6 +122,7 @@ enum class OrderDepotActionFlag : uint8_t { Unbunch = 2, ///< Service the vehicle and then unbunch it. }; +/** Bitset of \c OrderDepotActionFlag elements. */ using OrderDepotActionFlags = EnumBitSet; /** diff --git a/src/pathfinder/yapf/yapf_type.hpp b/src/pathfinder/yapf/yapf_type.hpp index d284979cb8..29c17462f3 100644 --- a/src/pathfinder/yapf/yapf_type.hpp +++ b/src/pathfinder/yapf/yapf_type.hpp @@ -33,6 +33,8 @@ enum class EndSegmentReason : uint8_t { LookAheadEnd, ///< we have just passed the last look-ahead signal TargetReached, ///< we have just reached the destination }; + +/** Bitset of \c EndSegmentReason elements. */ using EndSegmentReasons = EnumBitSet; /** What reasons mean that the target can be found and needs to be detected. */ diff --git a/src/picker_gui.h b/src/picker_gui.h index f9bd8dbe4f..01a13e9538 100644 --- a/src/picker_gui.h +++ b/src/picker_gui.h @@ -326,6 +326,8 @@ public: Validate, ///< Validate selected item. Filter, ///< Update filter state. }; + + /** Bitset of \c Pickerinvalidation elements. */ using PickerInvalidations = EnumBitSet; static constexpr PickerInvalidations PICKER_INVALIDATION_ALL{PickerInvalidation::Class, PickerInvalidation::Type, PickerInvalidation::Position, PickerInvalidation::Validate}; diff --git a/src/rail.h b/src/rail.h index 9356a65014..08b42de46a 100644 --- a/src/rail.h +++ b/src/rail.h @@ -32,6 +32,8 @@ enum class RailTypeFlag : uint8_t { Allow90Deg = 4, ///< Bit number for always allowed 90 degree turns, regardless of setting. Disallow90Deg = 5, ///< Bit number for never allowed 90 degree turns, regardless of setting. }; + +/** Bitset of \c RailTypeFlag elements. */ using RailTypeFlags = EnumBitSet; struct SpriteGroup; diff --git a/src/rail_type.h b/src/rail_type.h index fbbc6f85e7..ef14182687 100644 --- a/src/rail_type.h +++ b/src/rail_type.h @@ -35,6 +35,7 @@ enum RailType : uint8_t { /** Allow incrementing of Track variables */ DECLARE_INCREMENT_DECREMENT_OPERATORS(RailType) +/** Bitset of \c RailType elements. */ using RailTypes = EnumBitSet; static constexpr RailTypes INVALID_RAILTYPES{UINT64_MAX}; diff --git a/src/road.h b/src/road.h index e21fdf5452..df65bc20ad 100644 --- a/src/road.h +++ b/src/road.h @@ -28,6 +28,8 @@ enum class RoadTypeFlag : uint8_t { Hidden = 3, ///< Bit number for hidden from construction. TownBuild = 4, ///< Bit number for allowing towns to build this roadtype. }; + +/** Bitset of \c RoadTypeFlag elements. */ using RoadTypeFlags = EnumBitSet; struct SpriteGroup; diff --git a/src/road_type.h b/src/road_type.h index 6a68a1aa8a..c00ac76748 100644 --- a/src/road_type.h +++ b/src/road_type.h @@ -29,6 +29,7 @@ enum RoadType : uint8_t { }; DECLARE_INCREMENT_DECREMENT_OPERATORS(RoadType) +/** Bitset of \c RoadType elements. */ using RoadTypes = EnumBitSet; /** diff --git a/src/roadstop_base.h b/src/roadstop_base.h index 85d7028117..f3680042cd 100644 --- a/src/roadstop_base.h +++ b/src/roadstop_base.h @@ -26,6 +26,8 @@ struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> { BaseEntry = 6, ///< Non-zero when the entries on this road stop are the primary, i.e. the ones to delete EntryBusy = 7, ///< Non-zero when roadstop entry is busy }; + + /** Bitset of \c RoadStopStatusFlag elements. */ using RoadStopStatusFlags = EnumBitSet; /** Container for each entry point of a drive through road stop */ diff --git a/src/script/script_config.hpp b/src/script/script_config.hpp index 85ab2877a6..fd8f0680ec 100644 --- a/src/script/script_config.hpp +++ b/src/script/script_config.hpp @@ -25,6 +25,7 @@ enum class ScriptConfigFlag : uint8_t { Developer = 3, ///< This setting will only be visible when the Script development tools are active. }; +/** Bitset of \c ScriptConfigFlag elements. */ using ScriptConfigFlags = EnumBitSet; typedef std::map LabelMapping; ///< Map-type used to map the setting numbers to labels. diff --git a/src/settings_internal.h b/src/settings_internal.h index 121ef967ad..4b12938fea 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -30,6 +30,8 @@ enum class SettingFlag : uint8_t { NoNetworkSync, ///< Do not synchronize over network (but it is saved if SettingFlag::NotInSave is not set). Sandbox, ///< This setting is a sandbox setting. }; + +/** Bitset of \c SettingFlag elements. */ using SettingFlags = EnumBitSet; /** diff --git a/src/signal.cpp b/src/signal.cpp index e3c73dab20..d6b37252d7 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -262,6 +262,8 @@ enum class SigFlag : uint8_t { Enter, ///< signal entering the block found MultiEnter, ///< two or more signals entering the block found }; + +/** Bitset of \c SigFlag elements. */ using SigFlags = EnumBitSet; /** diff --git a/src/spritecache_type.h b/src/spritecache_type.h index 3905457971..150c1eba7f 100644 --- a/src/spritecache_type.h +++ b/src/spritecache_type.h @@ -29,6 +29,7 @@ enum class SpriteCacheCtrlFlag : uint8_t { AllowZoomMin2x32bpp, ///< Allow use of sprite min zoom setting at 2x in 32bpp mode. }; +/** Bitset of \c SpriteCacheCtrlFlag elements. */ using SpriteCacheCtrlFlags = EnumBitSet; #endif /* SPRITECACHE_TYPE_H */ diff --git a/src/spriteloader/spriteloader.hpp b/src/spriteloader/spriteloader.hpp index 4034064cfe..504b76df68 100644 --- a/src/spriteloader/spriteloader.hpp +++ b/src/spriteloader/spriteloader.hpp @@ -25,6 +25,8 @@ enum class SpriteComponent : uint8_t { Palette = 2, ///< Sprite has palette data. End, ///< End marker. }; + +/** Bitset of \c SpriteComponent elements. */ using SpriteComponents = EnumBitSet; /** diff --git a/src/station_base.h b/src/station_base.h index fc7c66e1da..f2db5c1483 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -207,6 +207,8 @@ struct GoodsEntry { */ AcceptedBigtick = 5, }; + + /** Bitset of \c State elements. */ using States = EnumBitSet; struct GoodsEntryData { diff --git a/src/station_type.h b/src/station_type.h index 0c0db0f561..59757a96f3 100644 --- a/src/station_type.h +++ b/src/station_type.h @@ -55,6 +55,8 @@ enum class StationFacility : uint8_t { Dock = 4, ///< Station with a dock Waypoint = 7, ///< Station is a waypoint }; + +/** Bitset of \c StationFacility elements. */ using StationFacilities = EnumBitSet; /** Fake 'facility' to allow toggling display of recently-removed station signs. */ @@ -83,6 +85,8 @@ enum class StationRandomTrigger : uint8_t { VehicleLoads, ///< Trigger platform when train loads/unloads. PathReservation, ///< Trigger platform when train reserves path. }; + +/** Bitset of \c StationRandomTrigger elements. */ using StationRandomTriggers = EnumBitSet; /** Animation triggers for stations and roadstops. */ @@ -98,6 +102,8 @@ enum class StationAnimationTrigger : uint8_t { PathReservation, ///< Trigger platform when train reserves path. End, ///< End marker. }; + +/** Bitset of \c StationAnimationTrigger elements. */ using StationAnimationTriggers = EnumBitSet; /** Animation triggers for airport tiles */ @@ -109,6 +115,8 @@ enum class AirportAnimationTrigger : uint8_t { AcceptanceTick, ///< Triggered every 250 ticks (for all tiles at the same time). AirplaneTouchdown, ///< Triggered when an airplane (not a helicopter) touches down at the airport (for single tile). }; + +/** Bitset of \c AirportAnimationTrigger elements. */ using AirportAnimationTriggers = EnumBitSet; /* The different catchment area sizes. */ diff --git a/src/string_type.h b/src/string_type.h index 4aead7c571..61cd76abbf 100644 --- a/src/string_type.h +++ b/src/string_type.h @@ -53,6 +53,7 @@ enum class StringValidationSetting : uint8_t { ReplaceTabCrNlWithSpace, }; +/** Bitset of \c StringValidationSetting elements. */ using StringValidationSettings = EnumBitSet; diff --git a/src/subsidy_type.h b/src/subsidy_type.h index d31d7bc6f1..10b49e4359 100644 --- a/src/subsidy_type.h +++ b/src/subsidy_type.h @@ -19,6 +19,7 @@ enum class PartOfSubsidy : uint8_t { Destination, ///< town/industry is destination of subsidised path }; +/** Bitset of \c PartOfSubsidy elements. */ using PartsOfSubsidy = EnumBitSet; using SubsidyID = PoolID; ///< ID of a subsidy diff --git a/src/table/strgen_tables.h b/src/table/strgen_tables.h index 98d1e7b1f7..dfb6c9c1f0 100644 --- a/src/table/strgen_tables.h +++ b/src/table/strgen_tables.h @@ -15,6 +15,8 @@ enum class CmdFlag : uint8_t { Case, ///< These commands support cases Gender, ///< These commands support genders }; + +/** Bitset of \c CmdFlag elements. */ using CmdFlags = EnumBitSet; class StringBuilder; diff --git a/src/table/townname.h b/src/table/townname.h index 91854c3d8a..c1a259b3e0 100644 --- a/src/table/townname.h +++ b/src/table/townname.h @@ -1735,6 +1735,7 @@ enum class CzechAllowFlag : uint8_t { Long, }; +/** Bitset of \c CzechAllowFlag elements. */ using CzechAllowFlags = EnumBitSet; static constexpr CzechAllowFlags CZA_ALL = {CzechAllowFlag::Short, CzechAllowFlag::Middle, CzechAllowFlag::Long}; @@ -1746,6 +1747,7 @@ enum class CzechChooseFlag : uint8_t { NoPostfix, ///< Matched if no postfix was inserted. }; +/** Bitset of \c CzechChooseFlag elements. */ using CzechChooseFlags = EnumBitSet; static constexpr CzechChooseFlags CZC_ANY = {CzechChooseFlag::Colour, CzechChooseFlag::Postfix, CzechChooseFlag::NoPostfix}; diff --git a/src/textbuf_gui.h b/src/textbuf_gui.h index daa79e6d38..2a917c1ca0 100644 --- a/src/textbuf_gui.h +++ b/src/textbuf_gui.h @@ -22,6 +22,7 @@ enum class QueryStringFlag : uint8_t { EnableMove, ///< enable the 'Move' button }; +/** Bitset of \c QueryStringFlag elements. */ using QueryStringFlags = EnumBitSet; /** Callback procedure for the ShowQuery method. */ diff --git a/src/tile_cmd.h b/src/tile_cmd.h index ff8aea8710..792cdeb2eb 100644 --- a/src/tile_cmd.h +++ b/src/tile_cmd.h @@ -27,6 +27,7 @@ enum class VehicleEnterTileState : uint8_t { CannotEnter, ///< The vehicle cannot enter the tile }; +/** Bitset of \c VehicleEnterTileState elements. */ using VehicleEnterTileStates = EnumBitSet; /** Tile information, used while rendering the tile */ diff --git a/src/town.h b/src/town.h index af7ec690ef..83762c6f9e 100644 --- a/src/town.h +++ b/src/town.h @@ -45,6 +45,7 @@ enum class TownFlag : uint8_t { CustomGrowth = 3, ///< Growth rate is controlled by GS. }; +/** Bitset of \c TownFlag elements. */ using TownFlags = EnumBitSet; /** Data structure with cached data of towns. */ @@ -304,6 +305,8 @@ enum class TownAction : uint8_t { Bribe, ///< Try to bribe the council. End, ///< End marker. }; + +/** Bitset of \c TownAction elements. */ using TownActions = EnumBitSet; DECLARE_INCREMENT_DECREMENT_OPERATORS(TownAction); diff --git a/src/town_type.h b/src/town_type.h index d23d9910de..375af057ab 100644 --- a/src/town_type.h +++ b/src/town_type.h @@ -100,6 +100,7 @@ enum class TownExpandMode : uint8_t { Roads, ///< Allow town to place roads. }; +/** Bitset of \c TownExpandMode elements. */ using TownExpandModes = EnumBitSet; /** Town founding setting values. It needs to be 8bits, because we save and load it as such */ diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 07452f0ef9..4d4f8173e3 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -39,6 +39,8 @@ enum class VehState : uint8_t { AircraftBroken = 6, ///< Aircraft is broken down. Crashed = 7, ///< Vehicle is crashed. }; + +/** Bitset of \c VehState elements. */ using VehStates = EnumBitSet; /** Bit numbers used to indicate which of the #NewGRFCache values are valid. */ diff --git a/src/vehicle_type.h b/src/vehicle_type.h index a1f4c15ed7..f70896a2ae 100644 --- a/src/vehicle_type.h +++ b/src/vehicle_type.h @@ -57,6 +57,8 @@ enum class DepotCommandFlag : uint8_t { MassSend, ///< Tells that it's a mass send to depot command (type in VLW flag) DontCancel, ///< Don't cancel current goto depot command if any }; + +/** Bitset of \c DepotCommandFlag elements. */ using DepotCommandFlags = EnumBitSet; static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32; ///< The maximum length of a vehicle name in characters including '\0' @@ -88,6 +90,8 @@ enum class VehicleRandomTrigger : uint8_t { AnyNewCargo, ///< All vehicles in consist: Any vehicle in the consist received new cargo. Callback32, ///< All vehicles in consist: 32 day callback requested rerandomisation }; + +/** Bitset of \c VehicleRandomTrigger elements. */ using VehicleRandomTriggers = EnumBitSet; /** diff --git a/src/viewport_type.h b/src/viewport_type.h index 017cf77a5a..9bb122b39a 100644 --- a/src/viewport_type.h +++ b/src/viewport_type.h @@ -23,6 +23,8 @@ enum class ViewportStringFlag : uint8_t { TransparentRect, ///< Draw a transparent rect around the sign. TextColour, ///< Draw text in colour. }; + +/** Bitset of \c ViewportStringFlag elements. */ using ViewportStringFlags = EnumBitSet; /** diff --git a/src/widget_type.h b/src/widget_type.h index 5c71b1dfb1..846f489f2d 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -120,6 +120,8 @@ enum class AspectFlag : uint8_t { ResizeX, ///< Resize horizontally to reach desired aspect ratio. ResizeY, ///< Resize vertically to reach desired aspect ratio. }; + +/** Bitset of \c AspectFlag elements. */ using AspectFlags = EnumBitSet; /* Forward declarations. */ @@ -375,6 +377,8 @@ enum class NWidgetDisplayFlag : uint8_t { Highlight, ///< Highlight of widget is on. DropdownClosed, ///< Dropdown menu of the dropdown widget has closed. }; + +/** Bitset of \c NWidgetDisplayFlag elements. */ using NWidgetDisplayFlags = EnumBitSet; /** Container with the data associated to a single widget. */ @@ -570,6 +574,8 @@ enum class NWidContainerFlag : uint8_t { EqualSize, ///< Containers should keep all their (resizing) children equally large. BigFirst, ///< Allocate space to biggest resize first. }; + +/** Bitset of \c NWidContainerFlag elements. */ using NWidContainerFlags = EnumBitSet; /** Container with pre/inter/post child space. */ diff --git a/src/window_gui.h b/src/window_gui.h index 2a6bfc889a..048491c980 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -27,6 +27,8 @@ enum class FrameFlag : uint8_t { Lowered, ///< If set the frame is lowered and the background colour brighter (ie. buttons when pressed) Darkened, ///< If set the background is darker, allows for lowered frames with normal background colour when used with FrameFlag::Lowered (ie. dropdown boxes) }; + +/** Bitset of \c FrameFlag elements. */ using FrameFlags = EnumBitSet; class WidgetDimensions { @@ -155,6 +157,8 @@ enum class WindowDefaultFlag : uint8_t { NoFocus, ///< This window won't get focus/make any other window lose focus when click NoClose, ///< This window can't be interactively closed }; + +/** Bitset of \c WindowDefaultFlag elements. */ using WindowDefaultFlags = EnumBitSet; Point GetToolbarAlignedWindowPosition(int window_width); @@ -236,6 +240,8 @@ enum class WindowFlag : uint8_t { Highlighted, ///< Window has a widget that has a highlight. Centred, ///< Window is centered and shall stay centered after ReInit. }; + +/** Bitset of \c WindowFlag elements. */ using WindowFlags = EnumBitSet; static const int TIMEOUT_DURATION = 7; ///< The initial timeout value for WindowFlag::Timeout. diff --git a/src/zoom_type.h b/src/zoom_type.h index 3d07ff3b3b..007191fb72 100644 --- a/src/zoom_type.h +++ b/src/zoom_type.h @@ -46,6 +46,8 @@ enum class ZoomLevel : int8_t { }; DECLARE_INCREMENT_DECREMENT_OPERATORS(ZoomLevel) DECLARE_ENUM_AS_SEQUENTIAL(ZoomLevel) + +/** Bitset of \c ZoomLevel elements. */ using ZoomLevels = EnumBitSet; static const uint ZOOM_BASE_SHIFT = to_underlying(ZoomLevel::Normal);