refactor(Core): apply clang-tidy modernize-use-nodiscard (#3835)

This commit is contained in:
Francesco Borzì
2020-12-06 19:39:48 +01:00
committed by GitHub
parent d4a58700d4
commit 161302252e
82 changed files with 1565 additions and 1569 deletions

View File

@@ -61,8 +61,8 @@ private:
uint32 iType;
public:
UnitBaseEvent(uint32 pType) { iType = pType; }
uint32 getType() const { return iType; }
bool matchesTypeMask(uint32 pMask) const { return iType & pMask; }
[[nodiscard]] uint32 getType() const { return iType; }
[[nodiscard]] bool matchesTypeMask(uint32 pMask) const { return iType & pMask; }
void setType(uint32 pType) { iType = pType; }
@@ -90,19 +90,19 @@ public:
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = pHostileReference; iBValue = pValue; }
int32 getIValue() const { return iIValue; }
[[nodiscard]] int32 getIValue() const { return iIValue; }
float getFValue() const { return iFValue; }
[[nodiscard]] float getFValue() const { return iFValue; }
bool getBValue() const { return iBValue; }
[[nodiscard]] bool getBValue() const { return iBValue; }
void setBValue(bool pValue) { iBValue = pValue; }
HostileReference* getReference() const { return iHostileReference; }
[[nodiscard]] HostileReference* getReference() const { return iHostileReference; }
void setThreatManager(ThreatManager* pThreatManager) { iThreatManager = pThreatManager; }
ThreatManager* getThreatManager() const { return iThreatManager; }
[[nodiscard]] ThreatManager* getThreatManager() const { return iThreatManager; }
};
//==============================================================
@@ -117,7 +117,7 @@ public:
void setThreatContainer(ThreatContainer* pThreatContainer) { iThreatContainer = pThreatContainer; }
ThreatContainer* getThreatContainer() const { return iThreatContainer; }
[[nodiscard]] ThreatContainer* getThreatContainer() const { return iThreatContainer; }
};
//==============================================================