Codechange: add doxygen comments for all EnumBitSet definitions (#15713)

This commit is contained in:
Peter Nelson
2026-06-13 20:48:55 +01:00
committed by GitHub
parent 3aee9889c2
commit 02792d8332
65 changed files with 181 additions and 0 deletions
+2
View File
@@ -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<VehicleAirFlag, uint8_t>;
static const int ROTOR_Z_OFFSET = 5; ///< Z Offset between helicopter- and rotorsprite.
+5
View File
@@ -56,6 +56,7 @@ enum class AirportMovingDataFlag : uint8_t {
Hold, ///< Holding pattern movement (above the airport).
};
/** Bitset of \c AirportMovingDataFlag elements. */
using AirportMovingDataFlags = EnumBitSet<AirportMovingDataFlag, uint16_t>;
/** 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<AirportBlock, uint64_t>;
/** 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<Flag, uint8_t>;
AirportFTAClass(
+2
View File
@@ -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<VehicleFlag, uint16_t>;
/** Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. */
+1
View File
@@ -63,6 +63,7 @@ public:
NoAnim, ///< The sprite has no palette animated pixel.
};
/** Bitset of \c SpriteFlag elements. */
using SpriteFlags = EnumBitSet<SpriteFlag, uint8_t>;
/** Data stored about a (single) sprite. */
+2
View File
@@ -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<ControlFlag, uint8_t>;
TimerGameCalendar::Year avail_year; ///< the year where it becomes available
+2
View File
@@ -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<BridgePillarFlag, uint8_t>;
static constexpr BridgePillarFlags BRIDGEPILLARFLAGS_ALL{
+1
View File
@@ -109,6 +109,7 @@ namespace CargoFilterCriteria {
*/
inline bool IsValidCargoType(CargoType cargo) { return cargo != INVALID_CARGO; }
/** Bitset of \c CargoType elements. */
using CargoTypes = EnumBitSet<CargoType, uint64_t>;
static constexpr CargoTypes ALL_CARGOTYPES{UINT64_MAX};
+2
View File
@@ -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<CargoClass, uint16_t>;
static const uint8_t INVALID_CARGO_BITNUM = 0xFF; ///< Constant representing invalid cargo
+4
View File
@@ -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<DoCommandFlag, uint16_t>;
/**
@@ -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<CommandFlag, uint16_t>;
/** Types of commands we have. */
+3
View File
@@ -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<PoolType, uint8_t>;
static constexpr PoolTypes PT_ALL = {PoolType::Normal, PoolType::NetworkClient, PoolType::NetworkAdmin, PoolType::Data};
typedef std::vector<struct PoolBase *> PoolVector; ///< Vector of pointers to PoolBase
+1
View File
@@ -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<Direction, uint8_t>;
/** All possible directions. */
+2
View File
@@ -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<DropDownOption, uint8_t>;
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);
+1
View File
@@ -30,6 +30,7 @@ enum class EngineDisplayFlag : uint8_t {
Shaded, ///< Set if engine should be masked.
};
/** Bitset of \c EngineDisplayFlag elements. */
using EngineDisplayFlags = EnumBitSet<EngineDisplayFlag, uint8_t>;
typedef Pool<Engine, EngineID, 64> EnginePool;
+6
View File
@@ -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<ExtraEngineFlag, uint8_t>;
/**
@@ -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<EngineMiscFlag, uint8_t>;
/**
@@ -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<EngineFlag, uint8_t>;
/**
+2
View File
@@ -67,6 +67,8 @@ public:
Scenario, ///< Scan for scenarios and heightmaps.
Game, ///< Scan for game scripts.
};
/** Bitset of \c Mode elements. */
using Modes = EnumBitSet<Mode, uint8_t>;
static constexpr Modes MODES_ALL = {Mode::Baseset, Mode::NewGRF, Mode::AI, Mode::Scenario, Mode::Game}; ///< Scan for everything.
+2
View File
@@ -256,6 +256,7 @@ enum class FontSize : uint8_t {
};
DECLARE_INCREMENT_DECREMENT_OPERATORS(FontSize)
/** Bitset of \c FontSize elements. */
using FontSizes = EnumBitSet<FontSize, uint8_t>;
/** 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<ExtendedTextColourFlag, uint8_t>; ///< Bitset of the flags of ExtendedTextColour. */
/** Container for the text colour and some text colour related flags for drawing. */
+2
View File
@@ -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<GroupFlag, uint8_t>;
/** Group data. */
+6
View File
@@ -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<BuildingFlag, uint8_t>;
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<HouseZone, uint16_t>;
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<HouseExtraFlag, uint8_t>;
struct HouseSpec {
+2
View File
@@ -27,6 +27,8 @@ enum class HouseRandomTrigger : uint8_t {
*/
TileLoopNorth,
};
/** Bitset of \c HouseRandomTrigger elements. */
using HouseRandomTriggers = EnumBitSet<HouseRandomTrigger, uint8_t>;
#endif /* HOUSE_TYPE_H */
+2
View File
@@ -54,6 +54,8 @@ enum class IndustryControlFlag : uint8_t {
ExternalProdLevel = 3,
End, ///< End marker.
};
/** Bitset of \c IndustryControlFlag elements. */
using IndustryControlFlags = EnumBitSet<IndustryControlFlag, uint8_t, IndustryControlFlag::End>;
/**
+4
View File
@@ -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<IndustryRandomTrigger, uint8_t>;
/** 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<IndustryAnimationTrigger, uint8_t>;
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).
+6
View File
@@ -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<IndustryLifeType, uint8_t>;
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<IndustryBehaviour, uint32_t>;
/** 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<IndustryTileSpecialFlag, uint8_t>;
/** Definition of one tile in an industry tile layout */
+4
View File
@@ -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<LandscapeType, uint8_t>;
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<BorderFlag, uint8_t>;
static constexpr BorderFlags BORDERFLAGS_ALL = BorderFlags{BorderFlag::NorthEast, BorderFlag::SouthEast, BorderFlag::SouthWest, BorderFlag::NorthWest}; ///< Border on all sides.
+1
View File
@@ -50,6 +50,7 @@ enum class EdgeUpdateMode : uint8_t {
Unrestricted, ///< Use unrestricted link.
};
/** Bitset of \c EdgeUpdateMode elements. */
using EdgeUpdateModes = EnumBitSet<EdgeUpdateMode, uint8_t>;
#endif /* LINKGRAPH_TYPE_H */
+1
View File
@@ -33,6 +33,7 @@ protected:
InAutorefit, ///< Currently doing an autorefit loop. Ignore the first autorefit order.
};
/** Bitset of \c RefreshFlag elements. */
using RefreshFlags = EnumBitSet<RefreshFlag, uint8_t>;
/**
+2
View File
@@ -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<Flag, uint8_t>;
Flags in_use{}; ///< Livery flags.
+3
View File
@@ -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<GrfMiscBit, uint8_t>;
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<GrfSpecFeature, uint32_t, GrfSpecFeature::End>;
static const uint32_t INVALID_GRFID = 0xFFFFFFFF;
+2
View File
@@ -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<BadgeFlag, uint8_t>;
using BadgeFilterChoices = std::unordered_map<BadgeClassID, BadgeID>;
+20
View File
@@ -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<VehicleCallbackMask, uint16_t>;
/**
@@ -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<StationCallbackMask, uint16_t>;
/**
@@ -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<RoadStopCallbackMask, uint8_t>;
/**
@@ -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<HouseCallbackMask, uint16_t>;
/**
@@ -361,6 +369,8 @@ using HouseCallbackMasks = EnumBitSet<HouseCallbackMask, uint16_t>;
enum class CanalCallbackMask : uint8_t {
SpriteOffset = 0, ///< Enable add sprite offset callback
};
/** Bitset of \c CanalCallbackMask elements. */
using CanalCallbackMasks = EnumBitSet<CanalCallbackMask, uint8_t>;
/**
@@ -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<CargoCallbackMask, uint8_t>;
/**
@@ -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<IndustryCallbackMask, uint16_t>;
/**
@@ -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<IndustryTileCallbackMask, uint8_t>;
/**
@@ -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<ObjectCallbackMask, uint8_t>;
/**
@@ -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<AirportTileCallbackMask, uint8_t>;
/**
+4
View File
@@ -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<GRFConfigFlag, uint8_t>;
/** 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<GRFBug, uint8_t>;
/** Status of post-gameload GRF compatibility check */
+2
View File
@@ -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<ObjectFlag, uint16_t>;
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.
+4
View File
@@ -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<RoadStopDrawMode, uint8_t>;
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<RoadStopSpecFlag, uint8_t>;
enum RoadStopView : uint8_t {
+5
View File
@@ -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<StationSpecFlag, uint8_t>;
/** Station specification. */
@@ -168,7 +170,10 @@ struct StationSpec : NewGRFSpecBase<StationClassID> {
NoWires = 1, ///< Tile should NOT contain catenary wires.
Blocked = 2, ///< Tile is blocked to vehicles.
};
/** Bitset of \c TileFlag elements. */
using TileFlags = EnumBitSet<TileFlag, uint8_t>;
std::vector<TileFlags> tileflags; ///< List of tile flags.
std::vector<BridgeableTileInfo> bridgeable_info; ///< Per tile layout bridge information.
+2
View File
@@ -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<NewsFlag, uint8_t>;
/**
+2
View File
@@ -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<ObjectAnimationTrigger, uint16_t>;
#endif /* OBJECT_TYPE_H */
+2
View File
@@ -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<PauseMode, uint8_t>;
/** The current pause mode */
+3
View File
@@ -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<OrderNonStopFlag, uint8_t>;
/**
@@ -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<OrderDepotTypeFlag, uint8_t>;
/**
@@ -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<OrderDepotActionFlag, uint8_t>;
/**
+2
View File
@@ -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<EndSegmentReason, uint16_t>;
/** What reasons mean that the target can be found and needs to be detected. */
+2
View File
@@ -326,6 +326,8 @@ public:
Validate, ///< Validate selected item.
Filter, ///< Update filter state.
};
/** Bitset of \c Pickerinvalidation elements. */
using PickerInvalidations = EnumBitSet<PickerInvalidation, uint8_t>;
static constexpr PickerInvalidations PICKER_INVALIDATION_ALL{PickerInvalidation::Class, PickerInvalidation::Type, PickerInvalidation::Position, PickerInvalidation::Validate};
+2
View File
@@ -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<RailTypeFlag, uint8_t>;
struct SpriteGroup;
+1
View File
@@ -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<RailType, uint64_t>;
static constexpr RailTypes INVALID_RAILTYPES{UINT64_MAX};
+2
View File
@@ -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<RoadTypeFlag, uint8_t>;
struct SpriteGroup;
+1
View File
@@ -29,6 +29,7 @@ enum RoadType : uint8_t {
};
DECLARE_INCREMENT_DECREMENT_OPERATORS(RoadType)
/** Bitset of \c RoadType elements. */
using RoadTypes = EnumBitSet<RoadType, uint64_t>;
/**
+2
View File
@@ -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<RoadStopStatusFlag, uint8_t>;
/** Container for each entry point of a drive through road stop */
+1
View File
@@ -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<ScriptConfigFlag, uint8_t>;
typedef std::map<int, std::string> LabelMapping; ///< Map-type used to map the setting numbers to labels.
+2
View File
@@ -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<SettingFlag, uint16_t>;
/**
+2
View File
@@ -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<SigFlag, uint16_t>;
/**
+1
View File
@@ -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<SpriteCacheCtrlFlag, uint8_t>;
#endif /* SPRITECACHE_TYPE_H */
+2
View File
@@ -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<SpriteComponent, uint8_t, SpriteComponent::End>;
/**
+2
View File
@@ -207,6 +207,8 @@ struct GoodsEntry {
*/
AcceptedBigtick = 5,
};
/** Bitset of \c State elements. */
using States = EnumBitSet<State, uint8_t>;
struct GoodsEntryData {
+8
View File
@@ -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<StationFacility, uint8_t>;
/** 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<StationRandomTrigger, uint8_t>;
/** 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<StationAnimationTrigger, uint16_t>;
/** 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<AirportAnimationTrigger, uint8_t>;
/* The different catchment area sizes. */
+1
View File
@@ -53,6 +53,7 @@ enum class StringValidationSetting : uint8_t {
ReplaceTabCrNlWithSpace,
};
/** Bitset of \c StringValidationSetting elements. */
using StringValidationSettings = EnumBitSet<StringValidationSetting, uint8_t>;
+1
View File
@@ -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<PartOfSubsidy, uint8_t>;
using SubsidyID = PoolID<uint16_t, struct SubsidyIDTag, 256, 0xFFFF>; ///< ID of a subsidy
+2
View File
@@ -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<CmdFlag, uint8_t>;
class StringBuilder;
+2
View File
@@ -1735,6 +1735,7 @@ enum class CzechAllowFlag : uint8_t {
Long,
};
/** Bitset of \c CzechAllowFlag elements. */
using CzechAllowFlags = EnumBitSet<CzechAllowFlag, uint8_t>;
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<CzechChooseFlag, uint8_t>;
static constexpr CzechChooseFlags CZC_ANY = {CzechChooseFlag::Colour, CzechChooseFlag::Postfix, CzechChooseFlag::NoPostfix};
+1
View File
@@ -22,6 +22,7 @@ enum class QueryStringFlag : uint8_t {
EnableMove, ///< enable the 'Move' button
};
/** Bitset of \c QueryStringFlag elements. */
using QueryStringFlags = EnumBitSet<QueryStringFlag, uint8_t>;
/** Callback procedure for the ShowQuery method. */
+1
View File
@@ -27,6 +27,7 @@ enum class VehicleEnterTileState : uint8_t {
CannotEnter, ///< The vehicle cannot enter the tile
};
/** Bitset of \c VehicleEnterTileState elements. */
using VehicleEnterTileStates = EnumBitSet<VehicleEnterTileState, uint8_t>;
/** Tile information, used while rendering the tile */
+3
View File
@@ -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<TownFlag, uint8_t>;
/** 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<TownAction, uint8_t>;
DECLARE_INCREMENT_DECREMENT_OPERATORS(TownAction);
+1
View File
@@ -100,6 +100,7 @@ enum class TownExpandMode : uint8_t {
Roads, ///< Allow town to place roads.
};
/** Bitset of \c TownExpandMode elements. */
using TownExpandModes = EnumBitSet<TownExpandMode, uint8_t>;
/** Town founding setting values. It needs to be 8bits, because we save and load it as such */
+2
View File
@@ -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<VehState, uint8_t>;
/** Bit numbers used to indicate which of the #NewGRFCache values are valid. */
+4
View File
@@ -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<DepotCommandFlag, uint8_t>;
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<VehicleRandomTrigger, uint8_t>;
/**
+2
View File
@@ -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<ViewportStringFlag, uint8_t>;
/**
+6
View File
@@ -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<AspectFlag, uint8_t>;
/* 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<NWidgetDisplayFlag, uint16_t>;
/** 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<NWidContainerFlag, uint8_t>;
/** Container with pre/inter/post child space. */
+6
View File
@@ -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<FrameFlag, uint8_t>;
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<WindowDefaultFlag, uint8_t>;
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<WindowFlag, uint16_t>;
static const int TIMEOUT_DURATION = 7; ///< The initial timeout value for WindowFlag::Timeout.
+2
View File
@@ -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<ZoomLevel, uint8_t>;
static const uint ZOOM_BASE_SHIFT = to_underlying(ZoomLevel::Normal);