diff --git a/src/company_type.h b/src/company_type.h index cdd9a414d6..5bd1d6b40c 100644 --- a/src/company_type.h +++ b/src/company_type.h @@ -45,9 +45,6 @@ static const uint MAX_COMPANY_SHARE_OWNERS = 4; ///< The maximum number static const uint MIN_COMPETITORS_INTERVAL = 0; ///< The minimum interval (in minutes) between competitors. static const uint MAX_COMPETITORS_INTERVAL = 500; ///< The maximum interval (in minutes) between competitors. -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - typedef Owner CompanyID; typedef uint16 CompanyMask; diff --git a/src/core/enum_type.hpp b/src/core/enum_type.hpp index f094bae914..273a5b077e 100644 --- a/src/core/enum_type.hpp +++ b/src/core/enum_type.hpp @@ -38,34 +38,4 @@ inline constexpr mask_t operator ~(mask_t m) {return (mask_t)(~(std::underlying_type::type)m);} -/** - * Informative template class exposing basic enumeration properties used by several - * other templates below. Here we have only forward declaration. For each enum type - * we will create specialization derived from MakeEnumPropsT<>. - * i.e.: - * template <> struct EnumPropsT : MakeEnumPropsT {}; - */ -template struct EnumPropsT; - -/** - * Helper template class that makes basic properties of given enumeration type visible - * from outsize. It is used as base class of several EnumPropsT specializations each - * dedicated to one of commonly used enumeration types. - * @param Tenum_t enumeration type that you want to describe - * @param Tstorage_t what storage type would be sufficient (i.e. byte) - * @param Tbegin first valid value from the contiguous range (i.e. TRACK_BEGIN) - * @param Tend one past the last valid value from the contiguous range (i.e. TRACK_END) - * @param Tinvalid value used as invalid value marker (i.e. INVALID_TRACK) - * @param Tnum_bits Number of bits for storing the enum in command parameters - */ -template -struct MakeEnumPropsT { - typedef Tenum_t type; ///< enum type (i.e. Trackdir) - typedef Tstorage_t storage; ///< storage type (i.e. byte) - static const Tenum_t begin = Tbegin; ///< lowest valid value (i.e. TRACKDIR_BEGIN) - static const Tenum_t end = Tend; ///< one after the last valid value (i.e. TRACKDIR_END) - static const Tenum_t invalid = Tinvalid; ///< what value is used as invalid value (i.e. INVALID_TRACKDIR) - static const uint num_bits = Tnum_bits; ///< Number of bits for storing the enum in command parameters -}; - #endif /* ENUM_TYPE_HPP */ diff --git a/src/direction_type.h b/src/direction_type.h index cb4595f09a..a7983a5c3d 100644 --- a/src/direction_type.h +++ b/src/direction_type.h @@ -38,10 +38,6 @@ enum Direction : byte { /** Allow incrementing of Direction variables */ DECLARE_POSTFIX_INCREMENT(Direction) -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - - /** * Enumeration for the difference between two directions. * @@ -87,10 +83,6 @@ enum DiagDirection : byte { /** Allow incrementing of DiagDirection variables */ DECLARE_POSTFIX_INCREMENT(DiagDirection) -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - - /** * Enumeration for the difference between to DiagDirection. * @@ -128,7 +120,5 @@ enum Axis : byte { AXIS_END, ///< Used for iterations INVALID_AXIS = 0xFF, ///< Flag for an invalid Axis }; -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; #endif /* DIRECTION_TYPE_H */ diff --git a/src/economy_type.h b/src/economy_type.h index 8b4b0901e8..f0f3fbe706 100644 --- a/src/economy_type.h +++ b/src/economy_type.h @@ -172,9 +172,6 @@ enum ExpensesType : byte { INVALID_EXPENSES = 0xFF, ///< Invalid expense type. }; -/** Define basic enum properties for ExpensesType */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** * Categories of a price bases. */ diff --git a/src/gfx_type.h b/src/gfx_type.h index 88cdbabacc..12d2b2c794 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -251,7 +251,6 @@ enum Colours : byte { COLOUR_END, INVALID_COLOUR = 0xFF, }; -template <> struct EnumPropsT : MakeEnumPropsT {}; /** Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palette.png */ enum TextColour { diff --git a/src/linkgraph/linkgraph_type.h b/src/linkgraph/linkgraph_type.h index 1839633bf6..89abef4e43 100644 --- a/src/linkgraph/linkgraph_type.h +++ b/src/linkgraph/linkgraph_type.h @@ -31,11 +31,6 @@ enum DistributionType : byte { DT_END = 3 }; -/* It needs to be 8bits, because we save and load it as such - * Define basic enum properties - */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** * Special modes for updating links. 'Restricted' means that vehicles with * 'no loading' orders are serving the link. If a link is only served by diff --git a/src/livery.h b/src/livery.h index 352cf6972e..730c29da33 100644 --- a/src/livery.h +++ b/src/livery.h @@ -57,8 +57,6 @@ enum LiveryScheme : byte { }; DECLARE_POSTFIX_INCREMENT(LiveryScheme) -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; /** List of different livery classes, used only by the livery GUI. */ enum LiveryClass { diff --git a/src/newgrf_roadstop.h b/src/newgrf_roadstop.h index fa05c30ba1..0ee524b0b3 100644 --- a/src/newgrf_roadstop.h +++ b/src/newgrf_roadstop.h @@ -161,9 +161,6 @@ struct RoadStopSpec { static const RoadStopSpec *Get(uint16 index); }; -template <> -struct EnumPropsT : MakeEnumPropsT {}; - typedef NewGRFClass RoadStopClass; void DrawRoadStopTile(int x, int y, RoadType roadtype, const RoadStopSpec *spec, StationType type, int view); diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 5273625ae6..c1f7235cdd 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -86,7 +86,6 @@ enum StationClassID : byte { STAT_CLASS_WAYP, ///< Waypoint class. STAT_CLASS_MAX = 255, ///< Maximum number of classes. }; -template <> struct EnumPropsT : MakeEnumPropsT {}; /** Allow incrementing of StationClassID variables */ DECLARE_POSTFIX_INCREMENT(StationClassID) diff --git a/src/order_type.h b/src/order_type.h index 1a0687794a..77fdb714db 100644 --- a/src/order_type.h +++ b/src/order_type.h @@ -152,7 +152,6 @@ enum ModifyOrderFlags : byte { MOF_COND_DESTINATION,///< Change the destination of a conditional order. MOF_END }; -template <> struct EnumPropsT : MakeEnumPropsT {}; /** * Depot action to switch to when doing a #MOF_DEPOT_ACTION. @@ -173,8 +172,6 @@ enum ModifyTimetableFlags : byte { MTF_TRAVEL_SPEED, ///< Set max travel speed. MTF_END }; -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** Clone actions. */ enum CloneOptions : byte { diff --git a/src/rail_type.h b/src/rail_type.h index 874a8ebbb6..6824007921 100644 --- a/src/rail_type.h +++ b/src/rail_type.h @@ -36,8 +36,6 @@ enum RailType : byte { /** Allow incrementing of Track variables */ DECLARE_POSTFIX_INCREMENT(RailType) -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; /** * The different railtypes we support, but then a bitmask of them. diff --git a/src/road_type.h b/src/road_type.h index a792db7ba5..58ac0a6010 100644 --- a/src/road_type.h +++ b/src/road_type.h @@ -27,7 +27,6 @@ enum RoadType : byte { INVALID_ROADTYPE = 63, ///< flag for invalid roadtype }; DECLARE_POSTFIX_INCREMENT(RoadType) -template <> struct EnumPropsT : MakeEnumPropsT {}; /** * The different roadtypes we support, but then a bitmask of them. @@ -66,7 +65,6 @@ enum RoadBits : byte { ROAD_END = ROAD_ALL + 1, ///< Out-of-range roadbits, used for iterations }; DECLARE_ENUM_AS_BIT_SET(RoadBits) -template <> struct EnumPropsT : MakeEnumPropsT {}; /** Which directions are disallowed ? */ enum DisallowedRoadDirections : byte { @@ -77,7 +75,5 @@ enum DisallowedRoadDirections : byte { DRD_END, ///< Sentinel }; DECLARE_ENUM_AS_BIT_SET(DisallowedRoadDirections) -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; #endif /* ROAD_TYPE_H */ diff --git a/src/signal_type.h b/src/signal_type.h index ff5dd3b553..b28c9ef108 100644 --- a/src/signal_type.h +++ b/src/signal_type.h @@ -32,9 +32,6 @@ enum SignalType : byte { SIGTYPE_LAST = SIGTYPE_PBS_ONEWAY, SIGTYPE_LAST_NOPBS = SIGTYPE_COMBO, }; -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** * These are states in which a signal can be. Currently these are only two, so diff --git a/src/story_base.h b/src/story_base.h index 09a8291fb6..52dcaa0c3b 100644 --- a/src/story_base.h +++ b/src/story_base.h @@ -38,9 +38,6 @@ enum StoryPageElementType : byte { INVALID_SPET = 0xFF, }; -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** Flags available for buttons */ enum StoryPageButtonFlags : byte { SPBF_NONE = 0, @@ -110,9 +107,6 @@ enum StoryPageButtonCursor : byte { INVALID_SPBC = 0xFF }; -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** * Checks if a StoryPageButtonCursor value is valid. * diff --git a/src/town_type.h b/src/town_type.h index d1dcdcfc42..80d6652d7a 100644 --- a/src/town_type.h +++ b/src/town_type.h @@ -24,7 +24,6 @@ enum TownSize : byte { TSZ_END, ///< Number of available town sizes. }; -template <> struct EnumPropsT : MakeEnumPropsT {}; enum Ratings { /* These refer to the maximums, so Appalling is -1000 to -400 @@ -88,7 +87,6 @@ enum TownLayout : byte { NUM_TLS, ///< Number of town layouts }; -template <> struct EnumPropsT : MakeEnumPropsT {}; /** Town founding setting values. It needs to be 8bits, because we save and load it as such */ enum TownFounding : byte { diff --git a/src/track_type.h b/src/track_type.h index 70278c58d9..d7a200e28a 100644 --- a/src/track_type.h +++ b/src/track_type.h @@ -30,9 +30,6 @@ enum Track : byte { /** Allow incrementing of Track variables */ DECLARE_POSTFIX_INCREMENT(Track) -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** Bitfield corresponding to Track */ enum TrackBits : byte { @@ -89,9 +86,6 @@ enum Trackdir : byte { INVALID_TRACKDIR = 0xFF, ///< Flag for an invalid trackdir }; -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** * Enumeration of bitmasks for the TrackDirs * diff --git a/src/transport_type.h b/src/transport_type.h index 172649aba5..7784e9205d 100644 --- a/src/transport_type.h +++ b/src/transport_type.h @@ -31,7 +31,5 @@ enum TransportType : byte { TRANSPORT_END, ///< End of iterations. INVALID_TRANSPORT = 0xff, ///< Sentinel for invalid transport types. }; -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; #endif /* TRANSPORT_TYPE_H */ diff --git a/src/vehicle_type.h b/src/vehicle_type.h index c302f5b9f5..ce8c606358 100644 --- a/src/vehicle_type.h +++ b/src/vehicle_type.h @@ -35,8 +35,6 @@ enum VehicleType : byte { VEH_INVALID = 0xFF, ///< Non-existing type of vehicle. }; DECLARE_POSTFIX_INCREMENT(VehicleType) -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; struct Vehicle; struct Train; diff --git a/src/water_map.h b/src/water_map.h index 97808d176b..9a0779b908 100644 --- a/src/water_map.h +++ b/src/water_map.h @@ -50,8 +50,6 @@ enum WaterClass : byte { WATER_CLASS_RIVER, ///< River. WATER_CLASS_INVALID, ///< Used for industry tiles on land (also for oilrig if newgrf says so). }; -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; /** * Checks if a water class is valid.