refactor(Core): apply clang-tidy modernize-* (#9975)

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Francesco Borzì
2022-01-17 14:35:07 +01:00
committed by GitHub
parent fe4899202d
commit 9dc88def35
71 changed files with 533 additions and 534 deletions

View File

@@ -248,7 +248,7 @@ enum ReputationSource
struct ActionButton
{
ActionButton() {}
ActionButton() = default;
uint32 packedData{0};
ActionButtonUpdateState uState{ACTIONBUTTON_NEW};
@@ -284,14 +284,14 @@ typedef std::list<PlayerCreateInfoItem> PlayerCreateInfoItems;
struct PlayerClassLevelInfo
{
PlayerClassLevelInfo() {}
PlayerClassLevelInfo() = default;
uint16 basehealth{0};
uint16 basemana{0};
};
struct PlayerClassInfo
{
PlayerClassInfo() { }
PlayerClassInfo() = default;
PlayerClassLevelInfo* levelInfo{nullptr}; //[level-1] 0..MaxPlayerLevel-1
};
@@ -307,7 +307,7 @@ typedef std::list<uint32> PlayerCreateInfoSpells;
struct PlayerCreateInfoAction
{
PlayerCreateInfoAction() {}
PlayerCreateInfoAction() = default;
PlayerCreateInfoAction(uint8 _button, uint32 _action, uint8 _type) : button(_button), type(_type), action(_action) {}
uint8 button{0};
@@ -328,7 +328,7 @@ typedef std::list<PlayerCreateInfoSkill> PlayerCreateInfoSkills;
struct PlayerInfo
{
// existence checked by displayId != 0
PlayerInfo() { }
PlayerInfo() = default;
uint32 mapId{0};
uint32 areaId{0};
@@ -349,7 +349,7 @@ struct PlayerInfo
struct PvPInfo
{
PvPInfo() {}
PvPInfo() = default;
bool IsHostile{false};
bool IsInHostileArea{false}; ///> Marks if player is in an area which forces PvP flag
@@ -433,7 +433,7 @@ struct Runes
struct EnchantDuration
{
EnchantDuration() {};
EnchantDuration() = default;;
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
leftduration(_leftduration) { ASSERT(item); };
@@ -739,7 +739,7 @@ enum EquipmentSetUpdateState
struct EquipmentSet
{
EquipmentSet() { }
EquipmentSet() = default;
uint64 Guid;
std::string Name;
@@ -1003,7 +1003,7 @@ class Player;
// holder for Battleground data (pussywizard: not stored in db)
struct BGData
{
BGData() {}
BGData() = default;
uint32 bgInstanceID{0};
BattlegroundTypeId bgTypeID{BATTLEGROUND_TYPE_NONE};
@@ -1161,14 +1161,14 @@ public:
[[nodiscard]] float GetRestBonus() const { return _restBonus; }
void SetRestBonus(float rest_bonus_new);
bool HasRestFlag(RestFlag restFlag) const { return (_restFlagMask & restFlag) != 0; }
[[nodiscard]] bool HasRestFlag(RestFlag restFlag) const { return (_restFlagMask & restFlag) != 0; }
void SetRestFlag(RestFlag restFlag, uint32 triggerId = 0);
void RemoveRestFlag(RestFlag restFlag);
[[nodiscard]] uint32 GetInnTriggerId() const { return _innTriggerId; }
PetStable* GetPetStable() { return m_petStable.get(); }
PetStable& GetOrInitPetStable();
PetStable const* GetPetStable() const { return m_petStable.get(); }
[[nodiscard]] PetStable const* GetPetStable() const { return m_petStable.get(); }
[[nodiscard]] Pet* GetPet() const;
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration = 0s);
@@ -1598,7 +1598,7 @@ public:
uint32 GetMailSize() { return m_mail.size();}
Mail* GetMail(uint32 id);
PlayerMails const& GetMails() const { return m_mail; }
[[nodiscard]] PlayerMails const& GetMails() const { return m_mail; }
void SendItemRetrievalMail(uint32 itemEntry, uint32 count); // Item retrieval mails sent by The Postmaster (34337)
void SendItemRetrievalMail(std::vector<std::pair<uint32, uint32>> mailItems); // Item retrieval mails sent by The Postmaster (34337)
@@ -1861,7 +1861,7 @@ public:
SetArenaTeamInfoField(slot, ARENA_TEAM_TYPE, type);
}
void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value);
uint32 GetArenaPersonalRating(uint8 slot) const;
[[nodiscard]] uint32 GetArenaPersonalRating(uint8 slot) const;
static uint32 GetArenaTeamIdFromDB(ObjectGuid guid, uint8 slot);
static void LeaveAllArenaTeams(ObjectGuid guid);
[[nodiscard]] uint32 GetArenaTeamId(uint8 slot) const;
@@ -1987,8 +1987,8 @@ public:
void RemoveCorpse();
void KillPlayer();
static void OfflineResurrect(ObjectGuid const guid, CharacterDatabaseTransaction trans);
bool HasCorpse() const { return _corpseLocation.GetMapId() != MAPID_INVALID; }
WorldLocation GetCorpseLocation() const { return _corpseLocation; }
[[nodiscard]] bool HasCorpse() const { return _corpseLocation.GetMapId() != MAPID_INVALID; }
[[nodiscard]] WorldLocation GetCorpseLocation() const { return _corpseLocation; }
uint32 GetResurrectionSpellId();
void ResurrectPlayer(float restore_percent, bool applySickness = false);
void BuildPlayerRepop();
@@ -2394,7 +2394,7 @@ public:
void SendCinematicStart(uint32 CinematicSequenceId);
void SendMovieStart(uint32 MovieId);
uint16 GetMaxSkillValueForLevel() const;
[[nodiscard]] uint16 GetMaxSkillValueForLevel() const;
bool IsFFAPvP();
bool IsPvP();
@@ -2591,7 +2591,7 @@ public:
void SetFarSightDistance(float radius);
void ResetFarSightDistance();
Optional<float> GetFarSightDistance() const;
[[nodiscard]] Optional<float> GetFarSightDistance() const;
float GetSightRange(const WorldObject* target = nullptr) const override;