nw::Item
-
struct Item : public nw::ObjectBase
Public Functions
-
Item()
-
Item(nw::MemoryResource *allocator)
-
virtual void clear() override
-
virtual bool instantiate() override
-
inline virtual InternedString tag() const override
-
Image get_icon_by_part(ItemModelParts::type part = ItemModelParts::model1, bool female = false) const
Gets image by item model part.
Note
Merging icons is also the responsibility of the caller.
-
PltColors part_to_plt_colors(ItemModelParts::type part) const noexcept
Converts model colors to Plt colors.
-
bool save(const std::filesystem::path &path, std::string_view format = "json")
Saves an object to the specified
path,formatcan be either ‘json’ or ‘gff’.
-
inline nw::MemoryResource *allocator() const noexcept
-
inline ObjectHandle handle() const noexcept
-
inline void set_handle(ObjectHandle handle)
-
const EffectArray &effects() const
-
EffectArray &effects()
-
inline Vector<VisualTransform> &visual_transform() noexcept
-
inline const Vector<VisualTransform> &visual_transform() const noexcept
-
void add_visual_transform(VisualTransform value)
Public Members
-
Vector<ItemProperty> properties
-
int armor_id = -1
-
uint32_t cost = 0
-
uint32_t additional_cost = 0
-
uint16_t stacksize = 1
-
uint8_t charges = 0
-
bool cursed = false
-
bool identified = false
-
bool plot = false
-
bool stolen = false
-
ItemModelType model_type = ItemModelType::simple
-
std::array<uint8_t, 6> model_colors
-
std::array<uint16_t, 19> model_parts
-
std::array<std::array<uint8_t, 6>, 19> part_colors
-
bool instantiated_ = false
Public Static Functions
-
static String get_name_from_file(const std::filesystem::path &path)
Public Static Attributes
-
static constexpr int json_archive_version = 1
-
static constexpr ObjectType object_type = ObjectType::item
-
static constexpr ResourceType::type restype = ResourceType::uti
-
static constexpr StringView serial_id = {"UTI"}
-
Item()