Implements ConstString in several core places in the library, improving performance.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-27 18:23:23 +01:00
parent 1d3a8da99e
commit 412e0a4d63
17 changed files with 161 additions and 148 deletions

View File

@@ -86,7 +86,7 @@ namespace CreatureLib::Battling {
return _heldItem != nullptr && _heldItem->GetName() == name;
}
inline const Library::Item* GetHeldItem() const { return _heldItem; }
void SetHeldItem(const std::string& itemName);
void SetHeldItem(const Arbutils::CaseInsensitiveConstString& itemName);
inline void SetHeldItem(const Library::Item* item) { _heldItem = item; };
inline uint32_t GetCurrentHealth() const { return _currentHealth; }
@@ -97,7 +97,7 @@ namespace CreatureLib::Battling {
void SetOnBattleField(bool value) { _onBattleField = value; }
bool IsOnBattleField() const { return _onBattleField; }
const std::string& GetNickname() const;
const std::string& GetNickname() const { return _nickname; }
const std::string& GetActiveTalent() const;
[[nodiscard]] bool IsFainted() const;