32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
#ifndef CREATURELIB_ITEM_HPP
|
|
#define CREATURELIB_ITEM_HPP
|
|
|
|
#include "BattleItemCategory.hpp"
|
|
#include "ItemCategory.hpp"
|
|
|
|
namespace CreatureLib::Library {
|
|
class Item {
|
|
protected:
|
|
ArbUt::StringView _name;
|
|
ItemCategory _category;
|
|
BattleItemCategory _battleCategory;
|
|
int32_t _price;
|
|
std::unordered_set<uint32_t> _flags;
|
|
|
|
public:
|
|
inline Item(const ArbUt::StringView& name, ItemCategory category, BattleItemCategory battleCategory,
|
|
int32_t price, const std::unordered_set<uint32_t>& flags) noexcept
|
|
: _name(name), _category(category), _battleCategory(battleCategory), _price(price), _flags(flags) {}
|
|
|
|
inline const ArbUt::StringView& GetName() const noexcept { return _name; }
|
|
inline ItemCategory GetCategory() const noexcept { return _category; }
|
|
inline BattleItemCategory GetBattleCategory() const noexcept { return _battleCategory; }
|
|
inline int32_t GetPrice() const noexcept { return _price; }
|
|
|
|
bool HasFlag(const ArbUt::BasicStringView& flag) const noexcept { return this->_flags.contains(flag); }
|
|
bool HasFlag(uint32_t flag) const noexcept { return this->_flags.contains(flag); }
|
|
};
|
|
}
|
|
|
|
#endif // CREATURELIB_ITEM_HPP
|