Horizon Official Technical Documentation
Horizon::Zone::Assets::Inventory Class Reference

#include <Inventory.hpp>

Public Member Functions

 Inventory (std::shared_ptr< Horizon::Zone::Units::Player > player, uint32_t max_storage)
 
virtual ~Inventory ()
 
int16_t get_free_index ()
 
std::shared_ptr< Horizon::Zone::Units::Playerplayer ()
 
inventory_addition_result_type add_item (std::shared_ptr< Horizon::Zone::Units::Item > floor_item)
 
inventory_addition_result_type add_item (uint32_t item_id, uint16_t amount, bool is_identified=false)
 
inventory_addition_result_type add_item (std::shared_ptr< item_entry_data > item, int amount)
 
std::shared_ptr< item_entry_dataget_item (uint32_t inventory_index)
 
inventory_removal_result_type remove_item (int16_t inventory_index, int amount, item_deletion_reason_type reason=ITEM_DEL_NORMAL)
 
void drop_item (uint32_t inventory_index, uint16_t amount)
 
void initialize ()
 Inventory initialization for player, called after Status is computed and notified. More...
 
bool use_item (uint32_t inventory_index, uint32_t guid)
 
bool can_equip (uint32_t inventory_index)
 
item_equip_result_type equip_item (uint32_t inventory_index, uint16_t equip_location_mask)
 
item_unequip_result_type unequip_item (uint32_t inventory_index)
 
EquipmentListTypeequipments ()
 
void add_to_equipment_list (std::shared_ptr< item_entry_data > item)
 
void remove_from_equipment_list (std::shared_ptr< item_entry_data > item)
 
void notify_all ()
 
void notify_without_equipments ()
 
void notify_only_equipments ()
 
void notify_add (std::shared_ptr< item_entry_data > const &item, uint16_t amount, inventory_addition_result_type fail)
 
void notify_deletion (uint16_t idx, uint16_t amount, inventory_deletion_reason_type reason)
 
void notify_drop (uint16_t idx, uint16_t amount)
 
void notify_move_fail (uint16_t idx, bool silent)
 
int32_t save ()
 
int32_t load ()
 
void set_max_storage (uint32_t max_storage)
 
uint32_t max_storage ()
 
void print_inventory ()
 

Protected Member Functions

uint32_t calculate_current_equip_location_mask (std::shared_ptr< const item_config_data > item)
 

Private Types

typedef std::vector< std::shared_ptr< item_entry_data > > storage_type
 

Private Attributes

int32_t _max_storage
 
std::weak_ptr< Horizon::Zone::Units::Player_player
 
EquipmentListType _equipments
 
storage_type _inventory_items
 
storage_type _saved_inventory_items
 

Member Typedef Documentation

◆ storage_type

typedef std::vector<std::shared_ptr<item_entry_data> > Horizon::Zone::Assets::Inventory::storage_type
private

Constructor & Destructor Documentation

◆ Inventory()

Inventory::Inventory ( std::shared_ptr< Horizon::Zone::Units::Player player,
uint32_t  max_storage 
)
52{
74}
@ IT_EQPI_ACC_L
Definition: ItemDefinitions.hpp:205
@ IT_EQPI_SHADOW_ACC_L
Definition: ItemDefinitions.hpp:225
@ IT_EQPI_COSTUME_LOW
Definition: ItemDefinitions.hpp:217
@ IT_EQPI_HAND_L
Definition: ItemDefinitions.hpp:213
@ IT_EQPI_SHADOW_SHIELD
Definition: ItemDefinitions.hpp:222
@ IT_EQPI_SHADOW_ARMOR
Definition: ItemDefinitions.hpp:220
@ IT_EQPI_SHOES
Definition: ItemDefinitions.hpp:207
@ IT_EQPI_AMMO
Definition: ItemDefinitions.hpp:219
@ IT_EQPI_COSTUME_GARMENT
Definition: ItemDefinitions.hpp:218
@ IT_EQPI_SHADOW_WEAPON
Definition: ItemDefinitions.hpp:221
@ IT_EQPI_HEAD_LOW
Definition: ItemDefinitions.hpp:209
@ IT_EQPI_GARMENT
Definition: ItemDefinitions.hpp:208
@ IT_EQPI_HEAD_MID
Definition: ItemDefinitions.hpp:210
@ IT_EQPI_HAND_R
Definition: ItemDefinitions.hpp:214
@ IT_EQPI_ARMOR
Definition: ItemDefinitions.hpp:212
@ IT_EQPI_COSTUME_MID
Definition: ItemDefinitions.hpp:216
@ IT_EQPI_ACC_R
Definition: ItemDefinitions.hpp:206
@ IT_EQPI_SHADOW_ACC_R
Definition: ItemDefinitions.hpp:224
@ IT_EQPI_COSTUME_TOP
Definition: ItemDefinitions.hpp:215
@ IT_EQPI_HEAD_TOP
Definition: ItemDefinitions.hpp:211
@ IT_EQPI_SHADOW_SHOES
Definition: ItemDefinitions.hpp:223
@ IT_EQPM_SHADOW_WEAPON
Definition: ItemDefinitions.hpp:186
@ IT_EQPM_SHADOW_ACC_R
Definition: ItemDefinitions.hpp:189
@ IT_EQPM_SHOES
Definition: ItemDefinitions.hpp:175
@ IT_EQPM_COSTUME_HEAD_TOP
Definition: ItemDefinitions.hpp:179
@ IT_EQPM_AMMO
Definition: ItemDefinitions.hpp:184
@ IT_EQPM_ARMOR
Definition: ItemDefinitions.hpp:173
@ IT_EQPM_HEAD_MID
Definition: ItemDefinitions.hpp:178
@ IT_EQPM_HAND_R
Definition: ItemDefinitions.hpp:170
@ IT_EQPM_HEAD_LOW
Definition: ItemDefinitions.hpp:169
@ IT_EQPM_HEAD_TOP
Definition: ItemDefinitions.hpp:177
@ IT_EQPM_SHADOW_SHOES
Definition: ItemDefinitions.hpp:188
@ IT_EQPM_HAND_L
Definition: ItemDefinitions.hpp:174
@ IT_EQPM_COSTUME_HEAD_LOW
Definition: ItemDefinitions.hpp:181
@ IT_EQPM_SHADOW_ARMOR
Definition: ItemDefinitions.hpp:185
@ IT_EQPM_COSTUME_GARMENT
Definition: ItemDefinitions.hpp:182
@ IT_EQPM_SHADOW_SHIELD
Definition: ItemDefinitions.hpp:187
@ IT_EQPM_COSTUME_HEAD_MID
Definition: ItemDefinitions.hpp:180
@ IT_EQPM_ACC_R
Definition: ItemDefinitions.hpp:176
@ IT_EQPM_ACC_L
Definition: ItemDefinitions.hpp:172
@ IT_EQPM_GARMENT
Definition: ItemDefinitions.hpp:171
@ IT_EQPM_SHADOW_ACC_L
Definition: ItemDefinitions.hpp:190
uint32_t max_storage()
Definition: Inventory.hpp:112
int32_t _max_storage
Definition: Inventory.hpp:119
std::shared_ptr< Horizon::Zone::Units::Player > player()
Definition: Inventory.hpp:82
std::weak_ptr< Horizon::Zone::Units::Player > _player
Definition: Inventory.hpp:120
EquipmentListType _equipments
Definition: Inventory.hpp:121

References _equipments, IT_EQPI_ACC_L, IT_EQPI_ACC_R, IT_EQPI_AMMO, IT_EQPI_ARMOR, IT_EQPI_COSTUME_GARMENT, IT_EQPI_COSTUME_LOW, IT_EQPI_COSTUME_MID, IT_EQPI_COSTUME_TOP, IT_EQPI_GARMENT, IT_EQPI_HAND_L, IT_EQPI_HAND_R, IT_EQPI_HEAD_LOW, IT_EQPI_HEAD_MID, IT_EQPI_HEAD_TOP, IT_EQPI_SHADOW_ACC_L, IT_EQPI_SHADOW_ACC_R, IT_EQPI_SHADOW_ARMOR, IT_EQPI_SHADOW_SHIELD, IT_EQPI_SHADOW_SHOES, IT_EQPI_SHADOW_WEAPON, IT_EQPI_SHOES, IT_EQPM_ACC_L, IT_EQPM_ACC_R, IT_EQPM_AMMO, IT_EQPM_ARMOR, IT_EQPM_COSTUME_GARMENT, IT_EQPM_COSTUME_HEAD_LOW, IT_EQPM_COSTUME_HEAD_MID, IT_EQPM_COSTUME_HEAD_TOP, IT_EQPM_GARMENT, IT_EQPM_HAND_L, IT_EQPM_HAND_R, IT_EQPM_HEAD_LOW, IT_EQPM_HEAD_MID, IT_EQPM_HEAD_TOP, IT_EQPM_SHADOW_ACC_L, IT_EQPM_SHADOW_ACC_R, IT_EQPM_SHADOW_ARMOR, IT_EQPM_SHADOW_SHIELD, IT_EQPM_SHADOW_SHOES, IT_EQPM_SHADOW_WEAPON, and IT_EQPM_SHOES.

◆ ~Inventory()

Inventory::~Inventory ( )
virtual
77{
78 //
79}

Member Function Documentation

◆ add_item() [1/3]

inventory_addition_result_type Inventory::add_item ( std::shared_ptr< Horizon::Zone::Units::Item floor_item)
307{
308 if (floor_item->entry() == nullptr)
309 return add_item(floor_item->config()->item_id, floor_item->amount(), floor_item->is_identified());
310
311 return add_item(floor_item->entry(), floor_item->amount());
312}
inventory_addition_result_type add_item(std::shared_ptr< Horizon::Zone::Units::Item > floor_item)
Definition: Inventory.cpp:306

References add_item().

Referenced by add_item(), and Horizon::Zone::PlayerComponent::sync_data_types().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_item() [2/3]

inventory_addition_result_type Inventory::add_item ( std::shared_ptr< item_entry_data item,
int  amount 
)
315{
316 if (item == nullptr)
318
319 if (item->config == nullptr)
321
322 std::shared_ptr<Horizon::Zone::Traits::CurrentWeight> current_weight = player()->status()->current_weight();
323 std::shared_ptr<Horizon::Zone::Traits::MaxWeight> max_weight = player()->status()->max_weight();
324
325 if (amount <= 0)
327
328 if (*current_weight + (amount * item->config->weight) > max_weight->total()) {
329 notify_add(item, item->amount, INVENTORY_ADD_OVER_WEIGHT);
331 }
332
333 if (item->config->stack.inventory > 0 && (amount > item->config->stack.inventory)) {
336 }
337
338 if (amount > MAX_INVENTORY_STACK_LIMIT) {
341 }
342
343 if (_inventory_items.size() >= max_storage()) {
346 }
347
348 // Check if item is stackable
349 if (item->is_stackable()) {
350 // Check if item exists in inventory.
351 auto invitem = std::find_if(_inventory_items.begin(), _inventory_items.end(),
352 [&item] (std::shared_ptr<item_entry_data> invit) {
353 if (invit == nullptr)
354 return false;
355 return (invit->amount < MAX_INVENTORY_STACK_LIMIT && *invit == *item);
356 }
357 );
358 // If item was found in inventory...
359 if (invitem != _inventory_items.end()) {
360 std::shared_ptr<item_entry_data> it_entry = *invitem;
361 // Check if amount exeeds stack size.
362 if (it_entry->amount + amount > MAX_INVENTORY_STACK_LIMIT) {
363 // Add appropriately
364 int left_amt = it_entry->amount - MAX_INVENTORY_STACK_LIMIT;
365 it_entry->amount += left_amt;
366 item->amount -= left_amt;
367 add_item(item->item_id, amount, item->info.is_identified);
368 } else {
369 it_entry->amount += amount;
370 notify_add(it_entry, amount, INVENTORY_ADD_SUCCESS);
371
372 current_weight->add_base(item->config->weight * amount);
373 }
374 } else {
375 int index = get_free_index();
376 std::shared_ptr<item_entry_data> item_new_stack = std::make_shared<item_entry_data>(*item);
377 item_new_stack->amount = amount;
378 item_new_stack->storage_type = ITEM_STORE_INVENTORY;
379 item_new_stack->index.inventory = index + 2;
380 _inventory_items[index] = item_new_stack;
381 notify_add(item_new_stack, amount, INVENTORY_ADD_SUCCESS);
382
383 current_weight->add_base(item_new_stack->config->weight * amount);
384 }
385 } else {
386 int index = get_free_index();
387 std::shared_ptr<item_entry_data> it_entry = std::make_shared<item_entry_data>(*item);
388 it_entry->unique_id = player()->new_unique_id();
389 it_entry->amount = 1;
390 it_entry->storage_type = ITEM_STORE_INVENTORY;
391 it_entry->index.inventory = index + 2;
392 _inventory_items[index] = it_entry;
393 notify_add(it_entry, it_entry->amount, INVENTORY_ADD_SUCCESS);
394 current_weight->add_base(item->config->weight);
395 if (--amount)
396 add_item(item, amount);
397 }
398
400}
#define MAX_INVENTORY_STACK_LIMIT
Definition: ItemDefinitions.hpp:65
@ ITEM_STORE_INVENTORY
Definition: ItemDefinitions.hpp:405
storage_type _inventory_items
Definition: Inventory.hpp:122
int16_t get_free_index()
Definition: Inventory.cpp:295
void notify_add(std::shared_ptr< item_entry_data > const &item, uint16_t amount, inventory_addition_result_type fail)
Definition: Inventory.cpp:477
@ INVENTORY_ADD_OVER_STACK_LIMIT
Max amount reached.
Definition: Inventory.hpp:53
@ INVENTORY_ADD_SUCCESS
Definition: Inventory.hpp:48
@ INVENTORY_ADD_INVALID
Success.
Definition: Inventory.hpp:49
@ INVENTORY_ADD_OVER_WEIGHT
Invalid itemid not found or negative amount.
Definition: Inventory.hpp:50
@ INVENTORY_ADD_OVER_QUANTITY
No free place found.
Definition: Inventory.hpp:52
@ INVENTORY_ADD_NO_INV_SPACE
Overweight.
Definition: Inventory.hpp:51

References _inventory_items, add_item(), get_free_index(), Horizon::Zone::Assets::INVENTORY_ADD_INVALID, Horizon::Zone::Assets::INVENTORY_ADD_NO_INV_SPACE, Horizon::Zone::Assets::INVENTORY_ADD_OVER_QUANTITY, Horizon::Zone::Assets::INVENTORY_ADD_OVER_STACK_LIMIT, Horizon::Zone::Assets::INVENTORY_ADD_OVER_WEIGHT, Horizon::Zone::Assets::INVENTORY_ADD_SUCCESS, ITEM_STORE_INVENTORY, MAX_INVENTORY_STACK_LIMIT, max_storage(), notify_add(), and player().

+ Here is the call graph for this function:

◆ add_item() [3/3]

inventory_addition_result_type Inventory::add_item ( uint32_t  item_id,
uint16_t  amount,
bool  is_identified = false 
)
403{
404 item_entry_data data;
405
406 std::shared_ptr<const item_config_data> item_d = ItemDB->get_item_by_id(item_id);
407 std::shared_ptr<const job_config_data> job = JobDB->get_job_by_id(player()->job_id());
408
409 if (item_d == nullptr)
411
412 // Copy item properties from static db entry.
413 data.item_id = item_id;
414 data.type = item_d->type;
415 data.actual_equip_location_mask = item_d->equip_location_mask;
416 data.bind_type = IT_BIND_NONE;
417 data.info.is_identified = is_identified;
418 data.info.is_favorite = 0;
419 data.config = item_d;
420
421 std::shared_ptr<item_entry_data> inv_item = std::make_shared<item_entry_data>(data);
422
423 return add_item(inv_item, amount);
424}
#define ItemDB
Definition: ItemDB.hpp:119
@ IT_BIND_NONE
Definition: ItemDefinitions.hpp:287
#define JobDB
Definition: JobDB.hpp:87
unsigned is_favorite
Definition: ItemDefinitions.hpp:568
unsigned is_identified
Definition: ItemDefinitions.hpp:566
Structure used to store and convey item data in the state machine and in communication with the clien...
Definition: ItemDefinitions.hpp:414
uint32_t actual_equip_location_mask
Definition: ItemDefinitions.hpp:539
item_bind_type bind_type
Definition: ItemDefinitions.hpp:571
item_type type
Definition: ItemDefinitions.hpp:536
uint32_t item_id
Definition: ItemDefinitions.hpp:532
std::shared_ptr< const item_config_data > config
Definition: ItemDefinitions.hpp:574
struct item_entry_data::item_entry_info info

References item_entry_data::actual_equip_location_mask, add_item(), item_entry_data::bind_type, item_entry_data::config, item_entry_data::info, Horizon::Zone::Assets::INVENTORY_ADD_INVALID, item_entry_data::item_entry_info::is_favorite, item_entry_data::item_entry_info::is_identified, IT_BIND_NONE, item_entry_data::item_id, ItemDB, JobDB, player(), and item_entry_data::type.

+ Here is the call graph for this function:

◆ add_to_equipment_list()

void Inventory::add_to_equipment_list ( std::shared_ptr< item_entry_data item)
187{
188 for (int i = 0; i < (item_equip_location_index) IT_EQPI_MAX; i++) {
189 auto &equip = equipments()[i];
190 std::shared_ptr<item_entry_data> id = equip.second.lock();
191
192 // Unequip the existing item and wear the new item.
193 if ((item->current_equip_location_mask & equip.first)) {
194 if (!equip.second.expired() && unequip_item(id->index.inventory) == IT_UNEQUIP_FAIL)
195 return;
196 equip.second = item;
197 }
198 }
199}
item_equip_location_index
Definition: ItemDefinitions.hpp:204
@ IT_EQPI_MAX
Definition: ItemDefinitions.hpp:226
@ IT_UNEQUIP_FAIL
Definition: ItemDefinitions.hpp:330
EquipmentListType & equipments()
Definition: Inventory.hpp:96
item_unequip_result_type unequip_item(uint32_t inventory_index)
Definition: Inventory.cpp:161

References equipments(), IT_EQPI_MAX, IT_UNEQUIP_FAIL, and unequip_item().

Referenced by equip_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_current_equip_location_mask()

uint32_t Inventory::calculate_current_equip_location_mask ( std::shared_ptr< const item_config_data item)
protected
215{
216 job_class_mask job_mask = JobDB->job_id_to_mask((job_class_type) player()->job_id());
217 uint32_t current_equip_location_mask = item->equip_location_mask;
218
219 if (item->type == IT_TYPE_WEAPON) {
220 if (item->sub_type.weapon_t == IT_WT_DAGGER ||
221 item->sub_type.weapon_t == IT_WT_1HSWORD ||
222 item->sub_type.weapon_t == IT_WT_1HAXE) {
223 if ((job_mask & JMASK_ASSASSIN) == JMASK_ASSASSIN
224 || (job_mask & JMASK_KAGEROUOBORO) == JMASK_KAGEROUOBORO) {
225 if (item->equip_location_mask == IT_EQPM_HAND_R)
226 current_equip_location_mask = IT_EQPM_ARMS;
227 if (item->equip_location_mask == IT_EQPM_SHADOW_WEAPON)
228 current_equip_location_mask = IT_EQPM_SHADOW_ARMS;
229 }
230 }
231 }
232
233 if (current_equip_location_mask == IT_EQPM_ACC)
234 current_equip_location_mask = equipments()[IT_EQPI_ACC_L].second.expired() ? IT_EQPM_ACC_L : IT_EQPM_ACC_R;
235 else if (current_equip_location_mask == IT_EQPM_ARMS && item->equip_location_mask == IT_EQPM_WEAPON)
236 current_equip_location_mask = equipments()[IT_EQPI_HAND_L].second.expired() ? IT_EQPM_HAND_L : IT_EQPM_HAND_R;
237 else if (current_equip_location_mask == IT_EQPM_SHADOW_ACC)
238 current_equip_location_mask = equipments()[IT_EQPI_SHADOW_ACC_L].second.expired() ? IT_EQPM_SHADOW_ACC_L : IT_EQPM_SHADOW_ACC_R;
239 else if (current_equip_location_mask == IT_EQPM_SHADOW_ARMS && item->equip_location_mask == IT_EQPM_SHADOW_WEAPON)
240 current_equip_location_mask = equipments()[IT_EQPI_SHADOW_WEAPON].second.expired() ? IT_EQPM_SHADOW_WEAPON : IT_EQPM_SHADOW_SHIELD;
241
242 return current_equip_location_mask;
243}
@ IT_TYPE_WEAPON
Definition: ItemDefinitions.hpp:258
@ IT_EQPM_ACC
Definition: ItemDefinitions.hpp:197
@ IT_EQPM_SHADOW_ACC
Definition: ItemDefinitions.hpp:199
@ IT_EQPM_SHADOW_ARMS
Definition: ItemDefinitions.hpp:200
@ IT_EQPM_WEAPON
Definition: ItemDefinitions.hpp:193
@ IT_EQPM_ARMS
Definition: ItemDefinitions.hpp:195
@ IT_WT_1HSWORD
Definition: ItemDefinitions.hpp:102
@ IT_WT_1HAXE
Definition: ItemDefinitions.hpp:106
@ IT_WT_DAGGER
Definition: ItemDefinitions.hpp:101
job_class_mask
Definition: UnitDefinitions.hpp:650
@ JMASK_ASSASSIN
Definition: UnitDefinitions.hpp:705
@ JMASK_KAGEROUOBORO
Definition: UnitDefinitions.hpp:830
job_class_type
Definition: UnitDefinitions.hpp:474

References equipments(), IT_EQPI_ACC_L, IT_EQPI_HAND_L, IT_EQPI_SHADOW_ACC_L, IT_EQPI_SHADOW_WEAPON, IT_EQPM_ACC, IT_EQPM_ACC_L, IT_EQPM_ACC_R, IT_EQPM_ARMS, IT_EQPM_HAND_L, IT_EQPM_HAND_R, IT_EQPM_SHADOW_ACC, IT_EQPM_SHADOW_ACC_L, IT_EQPM_SHADOW_ACC_R, IT_EQPM_SHADOW_ARMS, IT_EQPM_SHADOW_SHIELD, IT_EQPM_SHADOW_WEAPON, IT_EQPM_WEAPON, IT_TYPE_WEAPON, IT_WT_1HAXE, IT_WT_1HSWORD, IT_WT_DAGGER, JMASK_ASSASSIN, JMASK_KAGEROUOBORO, JobDB, and player().

Referenced by equip_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ can_equip()

bool Horizon::Zone::Assets::Inventory::can_equip ( uint32_t  inventory_index)

◆ drop_item()

void Inventory::drop_item ( uint32_t  inventory_index,
uint16_t  amount 
)
454{
455 std::shared_ptr<item_entry_data> inv_item = get_item(inventory_index);
456
457 if (inv_item == nullptr)
458 return;
459
460 if (inv_item->config == nullptr)
461 return;
462
463 if (inv_item->amount < amount)
464 return;
465
466 player()->status()->current_weight()->sub_base(inv_item->config->weight * amount);
467
468 if (inv_item->amount == amount) {
469 inv_item = nullptr;
470 notify_drop(inventory_index, amount);
471 } else {
472 inv_item->amount -= amount;
473 notify_drop(inventory_index, amount);
474 }
475}
std::shared_ptr< item_entry_data > get_item(uint32_t inventory_index)
Definition: Inventory.cpp:448
void notify_drop(uint16_t idx, uint16_t amount)
Definition: Inventory.cpp:499

References get_item(), notify_drop(), and player().

+ Here is the call graph for this function:

◆ equip_item()

item_equip_result_type Inventory::equip_item ( uint32_t  inventory_index,
uint16_t  equip_location_mask 
)
108{
109 uint32_t job_id = player()->job_id();
110 std::shared_ptr<item_entry_data> inv_item = _inventory_items.at(inventory_index - 2);
111
112 if (inv_item == nullptr) {
113 HLog(debug) << "Inventory::equip_item: Could not wear item at inventory index " << inventory_index << " - Inventory data not found.";
114 return IT_EQUIP_FAIL;
115 }
116
117 if (inv_item->config == nullptr) {
118 player()->get_session()->clif()->notify_equip_item(inv_item, IT_EQUIP_FAIL);
119 return IT_EQUIP_FAIL;
120 }
121
122 if (inv_item->current_equip_location_mask != 0 || inv_item->config->equip_location_mask != equip_location_mask) {
123 player()->get_session()->clif()->notify_equip_item(inv_item, IT_EQUIP_FAIL);
124 return IT_EQUIP_FAIL;
125 }
126
127 auto req_job_it = std::find_if(inv_item->config->requirements.job_ids.begin(), inv_item->config->requirements.job_ids.end(),
128 [job_id](uint32_t id) {
129 return job_id == id;
130 });
131 if (req_job_it == inv_item->config->requirements.job_ids.end()) {
132 player()->get_session()->clif()->notify_equip_item(inv_item, IT_EQUIP_FAIL);
133 return IT_EQUIP_FAIL;
134 }
135
136 if (inv_item->config->config.bind_on_equip != 0 && inv_item->bind_type == IT_BIND_NONE) {
137 inv_item->bind_type = IT_BIND_CHARACTER;
138 player()->get_session()->clif()->notify_bind_on_equip(inv_item->index.inventory);
139 }
140
141 inv_item->current_equip_location_mask = calculate_current_equip_location_mask(inv_item->config);
142
143 add_to_equipment_list(inv_item);
144
145 if (inv_item->type == IT_TYPE_AMMO) {
146 player()->get_session()->clif()->notify_equip_arrow(inv_item);
147 player()->get_session()->clif()->notify_action_failure(3);
148 } else {
149 HLog(debug) << "Inventory Item " << inv_item->index.inventory << " - " << inv_item->item_id << "worn.";
150
151 player()->get_session()->clif()->notify_equip_item(inv_item, IT_EQUIP_SUCCESS);
152
153 player()->on_item_equip(inv_item);
154
156 }
157
158 return IT_EQUIP_SUCCESS;
159}
@ IT_EQUIP_FAIL
Definition: ItemDefinitions.hpp:324
@ IT_EQUIP_SUCCESS
Definition: ItemDefinitions.hpp:322
@ IT_TYPE_AMMO
Definition: ItemDefinitions.hpp:264
@ IT_BIND_CHARACTER
Definition: ItemDefinitions.hpp:292
#define HLog(type)
Definition: Logger.hpp:122
void add_to_equipment_list(std::shared_ptr< item_entry_data > item)
Definition: Inventory.cpp:186
uint32_t calculate_current_equip_location_mask(std::shared_ptr< const item_config_data > item)
Definition: Inventory.cpp:214
void print_inventory()
Definition: Inventory.cpp:245

References _inventory_items, add_to_equipment_list(), calculate_current_equip_location_mask(), HLog, IT_BIND_CHARACTER, IT_BIND_NONE, IT_EQUIP_FAIL, IT_EQUIP_SUCCESS, IT_TYPE_AMMO, player(), and print_inventory().

+ Here is the call graph for this function:

◆ equipments()

EquipmentListType & Horizon::Zone::Assets::Inventory::equipments ( )
inline

◆ get_free_index()

int16_t Inventory::get_free_index ( )
296{
297 for (auto i = _inventory_items.begin(); i != _inventory_items.end(); i++) {
298 if (*i == nullptr)
299 return std::distance(_inventory_items.begin(), i);
300 }
301
302 _inventory_items.resize(_inventory_items.size() + 1);
303 return _inventory_items.size() - 1;
304}

References _inventory_items.

Referenced by add_item().

+ Here is the caller graph for this function:

◆ get_item()

std::shared_ptr< item_entry_data > Inventory::get_item ( uint32_t  inventory_index)
449{
450 return _inventory_items.at(inventory_index - 2);
451}

References _inventory_items.

Referenced by drop_item(), and remove_item().

+ Here is the caller graph for this function:

◆ initialize()

void Inventory::initialize ( )

Inventory initialization for player, called after Status is computed and notified.

85{
86 for (auto item : _inventory_items) {
87 player()->status()->current_weight()->add_base(item->config->weight * item->amount);
88 }
89}

References _inventory_items, and player().

+ Here is the call graph for this function:

◆ load()

int32_t Inventory::load ( )
596{
597
598 std::shared_ptr<boost::mysql::tcp_ssl_connection> conn = sZone->get_database_connection();
599
600 try {
601 boost::mysql::statement stmt = conn->prepare_statement("SELECT `item_id`, `amount`, `equip_location_mask`, `refine_level`, `slot_item_id_0`,"
602 "`slot_item_id_1`, `slot_item_id_2`, `slot_item_id_3`, `hire_expire_date`, `element_type`, `opt_idx0`, `opt_val0`, `opt_idx1`, `opt_val1`,"
603 "`opt_idx2`, `opt_val2`, `opt_idx3`, `opt_val3`, `opt_idx4`, `opt_val4`, `is_identified`, `is_broken`, `is_favorite`, `bind_type`, `unique_id`"
604 " FROM `character_inventory` WHERE `char_id` = ?");
605 auto b1 = stmt.bind(player()->character()._character_id);
606 boost::mysql::results results;
607 conn->execute(b1, results);
608
609 if (_inventory_items.size() != 0) {
610 HLog(warning) << "Attempt to synchronize the saved inventory, which should be empty at the time of load or re-load, size: " << _inventory_items.size();
611 return 0;
612 }
613
614 int inventory_index = 2;
615 for (auto r : results.rows()) {
617
618 std::shared_ptr<const item_config_data> d = ItemDB->get_item_by_id(r[0].as_uint64());
619
621 i.index.inventory = inventory_index;
622 i.item_id = r[0].as_uint64();
623 i.type = d->type;
624 i.amount = r[1].as_uint64();
625 i.current_equip_location_mask = r[2].as_uint64();
626 i.actual_equip_location_mask = d->equip_location_mask;
627 i.refine_level = r[3].as_uint64();
628 i.config = d;
629
630 i.slot_item_id[0] = r[4].as_int64();
631 i.slot_item_id[1] = r[5].as_int64();
632 i.slot_item_id[2] = r[6].as_int64();
633 i.slot_item_id[3] = r[7].as_int64();
634
635 i.hire_expire_date = r[8].as_uint64();
636 i.sprite_id = d->sprite_id;
637
638 i.ele_type = (element_type)(int)r[9].as_uint64();
639
640 if (r[10].as_uint64()) {
641 i.option_data[0].set_index(r[10].as_uint64());
642 i.option_data[0].set_value(r[11].as_int64());
643 i.option_count = 1;
644 }
645
646 if (r[12].as_uint64()) {
647 i.option_data[1].set_index(r[12].as_uint64());
648 i.option_data[1].set_value(r[13].as_int64());
649 i.option_count = 2;
650 }
651
652 if (r[14].as_uint64()) {
653 i.option_data[2].set_index(r[14].as_uint64());
654 i.option_data[2].set_value(r[15].as_int64());
655 i.option_count = 3;
656 }
657
658 if (r[16].as_uint64()) {
659 i.option_data[3].set_index(r[16].as_uint64());
660 i.option_data[3].set_value(r[17].as_int64());
661 i.option_count = 4;
662 }
663
664 if (r[18].as_uint64()) {
665 i.option_data[4].set_index(r[18].as_uint64());
666 i.option_data[4].set_value(r[19].as_int64());
667 i.option_count = 5;
668 }
669
670 i.info.is_identified = r[20].as_int64();
671 i.info.is_broken = r[21].as_uint64();
672 i.info.is_favorite = r[22].as_uint64();
673
674 i.bind_type = (item_bind_type)(int)r[23].as_uint64(); // int16_t
675 i.unique_id = r[24].as_uint64();
676
677 std::shared_ptr<item_entry_data> item = std::make_shared<item_entry_data>(i);
678
679 _saved_inventory_items.resize(inventory_index - 2 + 1);
680 _inventory_items.resize(inventory_index - 2 + 1);
681 _saved_inventory_items[inventory_index - 2] = item;
682 _inventory_items[inventory_index - 2] = item;
683 inventory_index++;
684 }
685 }
686 catch (boost::mysql::error_with_diagnostics &error) {
687 HLog(error) << "Inventory::load:" << error.what();
688 return false;
689 }
690 catch (std::exception& error) {
691 HLog(error) << "Inventory::load:" << error.what();
692 return false;
693 }
694
695 HLog(info) << "Loaded inventory for (Character ID: " << player()->account()._account_id << ") with " << _inventory_items.size() << " items.";
696
697 return _inventory_items.size();
698}
uint32_t _character_id
4
Definition: Client.hpp:0
item_bind_type
Definition: ItemDefinitions.hpp:286
element_type
Definition: UnitDefinitions.hpp:970
#define sZone
Definition: Zone.hpp:247
storage_type _saved_inventory_items
Definition: Inventory.hpp:122
unsigned is_broken
Definition: ItemDefinitions.hpp:567
void set_index(int idx)
Definition: ItemDefinitions.hpp:555
void set_value(int val)
Definition: ItemDefinitions.hpp:558
uint16_t sprite_id
Definition: ItemDefinitions.hpp:549
uint64_t unique_id
Definition: ItemDefinitions.hpp:572
struct item_entry_data::options option_data[MAX_ITEM_OPTIONS]
uint8_t option_count
Definition: ItemDefinitions.hpp:552
uint32_t current_equip_location_mask
Definition: ItemDefinitions.hpp:538
element_type ele_type
Definition: ItemDefinitions.hpp:551
uint16_t inventory
Definition: ItemDefinitions.hpp:524
uint32_t slot_item_id[MAX_ITEM_SLOTS]
Definition: ItemDefinitions.hpp:544
union item_entry_data::@131 index
uint32_t hire_expire_date
Definition: ItemDefinitions.hpp:548
uint8_t refine_level
Definition: ItemDefinitions.hpp:540
uint16_t amount
Definition: ItemDefinitions.hpp:537
item_storage_type storage_type
Definition: ItemDefinitions.hpp:528

References _character_id, _inventory_items, _saved_inventory_items, item_entry_data::actual_equip_location_mask, item_entry_data::amount, item_entry_data::bind_type, item_entry_data::config, item_entry_data::current_equip_location_mask, item_entry_data::ele_type, item_entry_data::hire_expire_date, HLog, item_entry_data::index, item_entry_data::info, item_entry_data::inventory, item_entry_data::item_entry_info::is_broken, item_entry_data::item_entry_info::is_favorite, item_entry_data::item_entry_info::is_identified, item_entry_data::item_id, ITEM_STORE_INVENTORY, ItemDB, item_entry_data::option_count, item_entry_data::option_data, player(), item_entry_data::refine_level, item_entry_data::options::set_index(), item_entry_data::options::set_value(), item_entry_data::slot_item_id, item_entry_data::sprite_id, item_entry_data::storage_type, sZone, item_entry_data::type, and item_entry_data::unique_id.

+ Here is the call graph for this function:

◆ max_storage()

uint32_t Horizon::Zone::Assets::Inventory::max_storage ( )
inline
112{ return _max_storage; }

References _max_storage.

Referenced by add_item(), and set_max_storage().

+ Here is the caller graph for this function:

◆ notify_add()

void Inventory::notify_add ( std::shared_ptr< item_entry_data > const &  item,
uint16_t  amount,
inventory_addition_result_type  fail 
)
478{
480
481 switch (result)
482 {
483 case INVENTORY_ADD_SUCCESS: notif_type = ITEM_INV_ADD_SUCCESS; break;
484 case INVENTORY_ADD_INVALID: notif_type = ITEM_INV_ADD_INVALID; break;
485 case INVENTORY_ADD_OVER_WEIGHT: notif_type = ITEM_INV_ADD_OVER_WEIGHT; break;
489 }
490
491 player()->get_session()->clif()->notify_pickup_item(item, amount, notif_type);
492}
item_inventory_addition_notif_type
Definition: ItemDefinitions.hpp:297
@ ITEM_INV_ADD_OVER_WEIGHT
Definition: ItemDefinitions.hpp:300
@ ITEM_INV_ADD_SUCCESS
Definition: ItemDefinitions.hpp:298
@ ITEM_INV_ADD_NO_INV_SPACE
Definition: ItemDefinitions.hpp:302
@ ITEM_INV_ADD_OVER_STACK_LIMIT
Definition: ItemDefinitions.hpp:305
@ ITEM_INV_ADD_INVALID
Definition: ItemDefinitions.hpp:299
@ ITEM_INV_ADD_OVER_QUANTITY
Definition: ItemDefinitions.hpp:303

References Horizon::Zone::Assets::INVENTORY_ADD_INVALID, Horizon::Zone::Assets::INVENTORY_ADD_NO_INV_SPACE, Horizon::Zone::Assets::INVENTORY_ADD_OVER_QUANTITY, Horizon::Zone::Assets::INVENTORY_ADD_OVER_STACK_LIMIT, Horizon::Zone::Assets::INVENTORY_ADD_OVER_WEIGHT, Horizon::Zone::Assets::INVENTORY_ADD_SUCCESS, ITEM_INV_ADD_INVALID, ITEM_INV_ADD_NO_INV_SPACE, ITEM_INV_ADD_OVER_QUANTITY, ITEM_INV_ADD_OVER_STACK_LIMIT, ITEM_INV_ADD_OVER_WEIGHT, ITEM_INV_ADD_SUCCESS, and player().

Referenced by add_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notify_all()

void Inventory::notify_all ( )
263{
264 player()->get_session()->clif()->notify_inventory_start(INVTYPE_INVENTORY, "Inventory");
267 player()->get_session()->clif()->notify_inventory_end(INVTYPE_INVENTORY);
268}
@ INVTYPE_INVENTORY
Definition: ClientDefinitions.hpp:906
void notify_without_equipments()
Definition: Inventory.cpp:270
void notify_only_equipments()
Definition: Inventory.cpp:283

References INVTYPE_INVENTORY, notify_only_equipments(), notify_without_equipments(), and player().

+ Here is the call graph for this function:

◆ notify_deletion()

void Inventory::notify_deletion ( uint16_t  idx,
uint16_t  amount,
inventory_deletion_reason_type  reason 
)
495{
496
497}

◆ notify_drop()

void Inventory::notify_drop ( uint16_t  idx,
uint16_t  amount 
)
500{
501 player()->get_session()->clif()->notify_throw_item(idx, amount);
502}

References player().

Referenced by drop_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notify_move_fail()

void Inventory::notify_move_fail ( uint16_t  idx,
bool  silent 
)
505{
506
507}

◆ notify_only_equipments()

void Inventory::notify_only_equipments ( )
284{
285 std::vector<std::shared_ptr<const item_entry_data>> equipments;
286
287 for (auto eit = _inventory_items.begin(); eit != _inventory_items.end(); eit++) {
288 if ((*eit)->is_equipment())
289 equipments.push_back(*eit);
290 }
291
292 player()->get_session()->clif()->notify_equipment_item_list(equipments);
293}

References _inventory_items, equipments(), and player().

Referenced by notify_all().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notify_without_equipments()

void Inventory::notify_without_equipments ( )
271{
272 std::vector<std::shared_ptr<const item_entry_data>> normal_items;
273
274 for (auto nit = _inventory_items.begin(); nit != _inventory_items.end(); nit++) {
275 if ((*nit)->is_equipment() == false)
276 normal_items.push_back(*nit);
277 }
278
279 player()->get_session()->clif()->notify_normal_item_list(normal_items);
280
281}

References _inventory_items, and player().

Referenced by notify_all().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player()

std::shared_ptr< Horizon::Zone::Units::Player > Horizon::Zone::Assets::Inventory::player ( )
inline

◆ print_inventory()

void Inventory::print_inventory ( )
246{
247 HLog(debug) << " -- Inventory List --";
248 for (auto i : _inventory_items)
249 HLog(debug) << "Idx: " << i->index.inventory << " ItemID: " << i->item_id << " Amount: " << i->amount;
250
251
252 HLog(debug) << " -- Equipments List --";
253 for (int i = 0; i < IT_EQPI_MAX; i++) {
254 auto &equip = equipments()[i];
255 std::shared_ptr<const item_entry_data> id = equip.second.lock();
256 if (id != nullptr)
257 HLog(debug) << "Loc:" << std::hex << id->current_equip_location_mask << " Loc2: " << id->actual_equip_location_mask << " Idx: " << std::dec << id->index.inventory << " ItemID: " << id->item_id << " Amount: " << id->amount;
258 }
259}

References _inventory_items, equipments(), HLog, and IT_EQPI_MAX.

Referenced by equip_item(), and unequip_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_from_equipment_list()

void Inventory::remove_from_equipment_list ( std::shared_ptr< item_entry_data item)
202{
203 for (int i = 0; i < (item_equip_location_index) IT_EQPI_MAX; i++) {
204 auto &equip = equipments()[i];
205 std::shared_ptr<const item_entry_data> id = equip.second.lock();
206
207 if ((item->current_equip_location_mask & equip.first)) {
208 item->current_equip_location_mask &= ~equip.first;
209 equip.second.reset();
210 }
211 }
212}

References equipments(), and IT_EQPI_MAX.

Referenced by unequip_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_item()

inventory_removal_result_type Inventory::remove_item ( int16_t  inventory_index,
int  amount,
item_deletion_reason_type  reason = ITEM_DEL_NORMAL 
)
427{
428 std::shared_ptr<item_entry_data> inv_item = get_item(inventory_index);
429
430 std::shared_ptr<Horizon::Zone::Traits::CurrentWeight> current_weight = player()->status()->current_weight();
431
432 if (inv_item->amount - amount < 0)
434
435 if (amount > inv_item->amount || amount > MAX_INVENTORY_STACK_LIMIT)
437
438 if (inv_item->amount - amount == 0)
439 _inventory_items[inventory_index - 2] = nullptr;
440 else
441 inv_item->amount -= amount;
442
443 player()->get_session()->clif()->notify_delete_item(inventory_index, amount, reason);
444 current_weight->sub_base(inv_item->config->weight * amount);
445
447}
@ INVENTORY_REMOVE_SUCCESS
Definition: Inventory.hpp:58
@ INVENTORY_REMOVE_INVALID
Success.
Definition: Inventory.hpp:59

References _inventory_items, get_item(), Horizon::Zone::Assets::INVENTORY_REMOVE_INVALID, Horizon::Zone::Assets::INVENTORY_REMOVE_SUCCESS, MAX_INVENTORY_STACK_LIMIT, and player().

+ Here is the call graph for this function:

◆ save()

int32_t Inventory::save ( )
510{
511 int32_t changes = 0;
512
513 // Erase saved vector and copy the current inventory.
515 std::copy(_inventory_items.begin(), _inventory_items.end(), std::inserter(_saved_inventory_items, _saved_inventory_items.end()));
516
517 std::shared_ptr<boost::mysql::tcp_ssl_connection> conn = sZone->get_database_connection();
518
519 try {
520 boost::mysql::statement stmt = conn->prepare_statement("DELETE FROM `character_inventory` WHERE `char_id` = ?");
521 auto b1 = stmt.bind(player()->character()._character_id);
522 boost::mysql::results results;
523 conn->execute(b1, results);
524
525 boost::format fmt_ctx = boost::format("INSERT INTO `character_inventory` (`char_id`, `item_id`, `amount`, `equip_location_mask`,"
526 "`is_identified`, `refine_level`, `element_type`, `slot_item_id_0`, `slot_item_id_1`, `slot_item_id_2`, `slot_item_id_3`, `opt_idx0`, `opt_val0`,"
527 "`opt_idx1`, `opt_val1`, `opt_idx2`, `opt_val2`, `opt_idx3`, `opt_val3`, `opt_idx4`, `opt_val4`, `hire_expire_date`, `is_favorite`, `is_broken`, `bind_type`, `unique_id`"
528 "VALUES ");
529
530 int count = 0;
531 for (auto mit_i = _saved_inventory_items.begin(); mit_i != _saved_inventory_items.end(); mit_i++) {
532 std::shared_ptr<const item_entry_data> mit = *mit_i;
533
534 if (mit == nullptr)
535 continue;
536
537 if (count != 0) {
538 std::string str = fmt_ctx.str();
539 fmt_ctx = boost::format(str.append(", "));
540 }
541
542 boost::format new_fmt = boost::format("(%1%, %2%, %3%, %4%, %5%, %6%, %7%, %8%, %9%, %10%, %11%, %12%, %13%, %14%, %15%, %16%, %17%, %18%, %19%, %20%, %21%, %22%, %23%, %24%, %25%, %26%)")
543 % player()->character()._character_id
544 % (int)mit->item_id
545 % (int)mit->amount
546 % (int)mit->current_equip_location_mask
547 % (int)mit->info.is_identified
548 % (int)mit->refine_level
549 % (int)mit->ele_type
550 % (int)mit->slot_item_id[0]
551 % (int)mit->slot_item_id[1]
552 % (int)mit->slot_item_id[2]
553 % (int)mit->slot_item_id[3]
554 % (int)mit->option_data[0].get_index()
555 % (int)mit->option_data[0].get_value()
556 % (int)mit->option_data[1].get_index()
557 % (int)mit->option_data[1].get_value()
558 % (int)mit->option_data[2].get_index()
559 % (int)mit->option_data[2].get_value()
560 % (int)mit->option_data[3].get_index()
561 % (int)mit->option_data[3].get_value()
562 % (int)mit->option_data[4].get_index()
563 % (int)mit->option_data[4].get_value()
564 % (int)mit->hire_expire_date
565 % (int)mit->info.is_favorite
566 % (int)mit->info.is_broken
567 % (int)mit->bind_type
568 % (int64_t)mit->unique_id;
569
570 std::string str_str = fmt_ctx.str() + new_fmt.str();
571 fmt_ctx = boost::format(str_str);
572 count++;
573 }
574
575 if (count) {
576 boost::mysql::results results;
577 conn->execute(fmt_ctx.str(), results);
578 }
579
580 changes = count;
581 }
582 catch (boost::mysql::error_with_diagnostics &error) {
583 HLog(error) << "Inventory::save:" << error.what();
584 return false;
585 }
586 catch (std::exception& error) {
587 HLog(error) << "Inventory::save:" << error.what();
588 return false;
589 }
590
591 HLog(info) << "Saved inventory for (Character ID: " << player()->account()._account_id << ") with " << changes << " changes.";
592 return changes;
593}
size_t count(GridTypeListContainer< SPECIFIC_TYPE > const &elements, SPECIFIC_TYPE *)
Definition: GridReferenceContainer.hpp:100

References _character_id, _inventory_items, _saved_inventory_items, GridTypeListIterator::count(), HLog, player(), and sZone.

+ Here is the call graph for this function:

◆ set_max_storage()

void Horizon::Zone::Assets::Inventory::set_max_storage ( uint32_t  max_storage)
inline

References _max_storage, and max_storage().

+ Here is the call graph for this function:

◆ unequip_item()

item_unequip_result_type Inventory::unequip_item ( uint32_t  inventory_index)
162{
163 std::shared_ptr<item_entry_data> inv_item = _inventory_items.at(inventory_index - 2);
164
165 if (inv_item == nullptr) {
166 player()->get_session()->clif()->notify_unequip_item(inv_item, IT_UNEQUIP_FAIL);
167 return IT_UNEQUIP_FAIL;
168 }
169
170 if (inv_item->config == nullptr) {
171 player()->get_session()->clif()->notify_unequip_item(inv_item, IT_UNEQUIP_FAIL);
172 return IT_UNEQUIP_FAIL;
173 }
174
175 player()->get_session()->clif()->notify_unequip_item(inv_item, IT_UNEQUIP_SUCCESS);
176
178
179 player()->on_item_unequip(inv_item);
180
182
183 return IT_UNEQUIP_SUCCESS;
184}
@ IT_UNEQUIP_SUCCESS
Definition: ItemDefinitions.hpp:329
void remove_from_equipment_list(std::shared_ptr< item_entry_data > item)
Definition: Inventory.cpp:201

References _inventory_items, IT_UNEQUIP_FAIL, IT_UNEQUIP_SUCCESS, player(), print_inventory(), and remove_from_equipment_list().

Referenced by add_to_equipment_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use_item()

bool Inventory::use_item ( uint32_t  inventory_index,
uint32_t  guid 
)
92{
93 std::shared_ptr<item_entry_data> inv_item = _inventory_items.at(inventory_index - 2);
94
95 if (inv_item == nullptr)
96 return false;
97
98 if (inv_item->config == nullptr) {
99 player()->get_session()->clif()->notify_use_item(inv_item, false);
100 return false;
101 }
102
103 player()->get_session()->clif()->notify_use_item(inv_item, true);
104 return true;
105}

References _inventory_items, and player().

+ Here is the call graph for this function:

Member Data Documentation

◆ _equipments

EquipmentListType Horizon::Zone::Assets::Inventory::_equipments
private

Referenced by equipments(), and Inventory().

◆ _inventory_items

◆ _max_storage

int32_t Horizon::Zone::Assets::Inventory::_max_storage
private

Referenced by max_storage(), and set_max_storage().

◆ _player

std::weak_ptr<Horizon::Zone::Units::Player> Horizon::Zone::Assets::Inventory::_player
private

Referenced by player().

◆ _saved_inventory_items

storage_type Horizon::Zone::Assets::Inventory::_saved_inventory_items
private

Referenced by load(), and save().


The documentation for this class was generated from the following files: