Tweaks and fixes for Item, added C interface.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
bool CreatureLib::Library::Item::HasFlag(const Arbutils::CaseInsensitiveConstString& flag) const {
|
||||
return this->_flags.find(flag) != this->_flags.end();
|
||||
}
|
||||
bool CreatureLib::Library::Item::HasFlag(uint32_t flag) const { return this->_flags.find(flag) != this->_flags.end(); }
|
||||
|
||||
CreatureLib::Library::Item::Item(const Arbutils::CaseInsensitiveConstString& name,
|
||||
CreatureLib::Library::ItemCategory category,
|
||||
CreatureLib::Library::BattleItemCategory battleCategory, int32_t price,
|
||||
std::unordered_set<Arbutils::CaseInsensitiveConstString> flags)
|
||||
std::unordered_set<uint32_t> flags)
|
||||
: _name(name), _category(category), _battleCategory(battleCategory), _price(price), _flags(flags) {}
|
||||
|
||||
@@ -14,11 +14,11 @@ namespace CreatureLib::Library {
|
||||
ItemCategory _category;
|
||||
BattleItemCategory _battleCategory;
|
||||
int32_t _price;
|
||||
std::unordered_set<Arbutils::CaseInsensitiveConstString> _flags;
|
||||
std::unordered_set<uint32_t> _flags;
|
||||
|
||||
public:
|
||||
Item(const Arbutils::CaseInsensitiveConstString& name, ItemCategory category, BattleItemCategory battleCategory,
|
||||
int32_t price, std::unordered_set<Arbutils::CaseInsensitiveConstString> flags);
|
||||
int32_t price, std::unordered_set<uint32_t> flags);
|
||||
|
||||
inline const Arbutils::CaseInsensitiveConstString& GetName() const { return _name; }
|
||||
inline ItemCategory GetCategory() const { return _category; }
|
||||
@@ -26,6 +26,7 @@ namespace CreatureLib::Library {
|
||||
inline const int32_t GetPrice() const { return _price; }
|
||||
|
||||
bool HasFlag(const Arbutils::CaseInsensitiveConstString& flag) const;
|
||||
bool HasFlag(uint32_t flag) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user