mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Cleanup] Use explicit conversions for enum formatting (#4064)
This is prep for updating to fmt 10 which removed implicit conversions for enums.
This commit is contained in:
@@ -64,4 +64,6 @@ typedef enum {
|
||||
} bodyType;
|
||||
/* bodytypes above 64 make the mob not show up */
|
||||
|
||||
constexpr int format_as(bodyType type) { return static_cast<int>(type); }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -71,6 +71,8 @@ namespace EQ
|
||||
bit_DeityAll = UINT32_MAX
|
||||
};
|
||||
|
||||
constexpr int format_as(DeityType type) { return static_cast<int>(type); }
|
||||
|
||||
extern DeityTypeBit GetDeityBitmask(DeityType deity_type);
|
||||
extern std::string GetDeityName(DeityType deity_type);
|
||||
extern const std::map<DeityType, std::string>& GetDeityMap();
|
||||
|
||||
@@ -45,6 +45,7 @@ typedef enum { //EQEmu internal opcodes list
|
||||
_maxEmuOpcode
|
||||
} EmuOpcode;
|
||||
|
||||
constexpr int format_as(EmuOpcode opcode) { return static_cast<int>(opcode); }
|
||||
extern const char *OpcodeNames[_maxEmuOpcode+1];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -81,5 +81,6 @@ typedef enum {
|
||||
GUILD_ACTION_MEMBERS_DEMOTE_SELF = 30,
|
||||
} GuildAction;
|
||||
|
||||
constexpr int format_as(GuildAction action) { return static_cast<int>(action); }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -158,6 +158,7 @@ namespace RoF2
|
||||
slotCursor
|
||||
};
|
||||
|
||||
constexpr int16 format_as(InventorySlots slot) { return static_cast<int16>(slot); }
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
|
||||
@@ -162,6 +162,8 @@ namespace EQ
|
||||
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
|
||||
#define PACKET_SKILL_ARRAY_SIZE 100
|
||||
|
||||
constexpr int format_as(SkillType skill) { return static_cast<int>(skill); }
|
||||
|
||||
bool IsTradeskill(SkillType skill);
|
||||
bool IsSpecializedSkill(SkillType skill);
|
||||
float GetSkillMeleePushForce(SkillType skill);
|
||||
|
||||
@@ -252,6 +252,8 @@ typedef enum {
|
||||
ActivityCompleted = 2
|
||||
} ActivityState;
|
||||
|
||||
constexpr int format_as(ActivityState state) { return static_cast<int>(state); }
|
||||
|
||||
struct ClientActivityInformation {
|
||||
int activity_id;
|
||||
int done_count;
|
||||
|
||||
@@ -54,6 +54,8 @@ namespace EQ
|
||||
tintInvalid = textureInvalid
|
||||
};
|
||||
|
||||
constexpr int format_as(TextureSlot slot) { return static_cast<int>(slot); }
|
||||
|
||||
const int8 LastTexture = weaponSecondary;
|
||||
const int8 LastTintableTexture = tintFeet;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user