diff --git a/src/Library/Items/Item.cpp b/src/Library/Items/Item.cpp index 4c4b049..b43d4ab 100644 --- a/src/Library/Items/Item.cpp +++ b/src/Library/Items/Item.cpp @@ -3,7 +3,8 @@ bool CreatureLib::Library::Item::HasFlag(const Arbutils::CaseInsensitiveConstString& flag) const { return this->_flags.find(flag) != this->_flags.end(); } -CreatureLib::Library::Item::Item(std::string name, CreatureLib::Library::ItemCategory category, +CreatureLib::Library::Item::Item(const Arbutils::CaseInsensitiveConstString& name, + CreatureLib::Library::ItemCategory category, CreatureLib::Library::BattleItemCategory battleCategory, int32_t price, std::unordered_set flags) : _name(name), _category(category), _battleCategory(battleCategory), _price(price), _flags(flags) {} diff --git a/src/Library/Items/Item.hpp b/src/Library/Items/Item.hpp index ffac227..58e6a61 100644 --- a/src/Library/Items/Item.hpp +++ b/src/Library/Items/Item.hpp @@ -10,17 +10,17 @@ namespace CreatureLib::Library { class Item { protected: - std::string _name; + Arbutils::CaseInsensitiveConstString _name; ItemCategory _category; BattleItemCategory _battleCategory; int32_t _price; std::unordered_set _flags; public: - Item(std::string name, ItemCategory category, BattleItemCategory battleCategory, int32_t price, - std::unordered_set flags); + Item(const Arbutils::CaseInsensitiveConstString& name, ItemCategory category, BattleItemCategory battleCategory, + int32_t price, std::unordered_set flags); - inline const std::string& GetName() const { return _name; } + inline const Arbutils::CaseInsensitiveConstString& GetName() const { return _name; } inline ItemCategory GetCategory() const { return _category; } inline BattleItemCategory GetBattleCategory() const { return _battleCategory; } inline const int32_t GetPrice() const { return _price; }