8 #include "../../../include/nlohmann/json.hpp"
9 #include "../../../include/types.h"
13 const char *what()
const throw();
18 const char *what()
const throw();
26 unsigned int gold_value;
29 inline void to_json(nlohmann::json &j,
const item_info_t &i) {
33 j[
"sprite_id"] = i.sprite_id;
34 j[
"gold_value"] = i.gold_value;
37 inline void from_json(
const nlohmann::json &j,
item_info_t &i) {
38 j[
"name"].get_to(i.name);
40 j[
"type"].get_to(i.type);
41 j[
"sprite_id"].get_to(i.sprite_id);
42 j[
"gold_value"].get_to(i.gold_value);
48 uint32_t actual_stack;
54 virtual nlohmann::json get_data()
const;
55 virtual nlohmann::json get_persist_data()
const;
56 void set_stack(uint32_t stack);
57 uint32_t get_stack()
const;
58 ItemId get_id()
const;
59 uint32_t get_sprite_id()
const;
60 item_type_t get_type()
const;
61 long int stack_difference(uint32_t other_stack);
62 void increase_stack(uint32_t stack);
63 void decrease_stack(uint32_t stack);
64 uint32_t get_gold_value()
const;