|
OpenGothic
Open source reimplementation of Gothic I and II
|
#include <inventory.h>
Classes | |
| class | Iterator |
Public Types | |
| enum | IteratorType : uint8_t { T_Inventory , T_Trade , T_Ransack } |
Public Member Functions | |
| Inventory () | |
| Inventory (Inventory &&)=default | |
| Inventory & | operator= (Inventory &&)=default |
| ~Inventory () | |
| bool | isEmpty () const |
| void | load (Serialize &s, Npc &owner) |
| void | load (Serialize &s, Interactive &owner, World &w) |
| void | save (Serialize &s) const |
| Iterator | iterator (IteratorType t) const |
| int32_t | priceOf (size_t item) const |
| int32_t | sellPriceOf (size_t item) const |
| size_t | goldCount () const |
| size_t | itemCount (const size_t id) const |
| Item * | getItem (size_t instance) |
| Item * | addItem (std::unique_ptr< Item > &&p) |
| Item * | addItem (std::string_view name, size_t count, World &owner) |
| Item * | addItem (size_t cls, size_t count, World &owner) |
| void | delItem (size_t cls, size_t count, Npc &owner) |
| bool | use (size_t cls, Npc &owner, uint8_t slotHint, bool force) |
| bool | equip (size_t cls, Npc &owner, bool force) |
| bool | unequip (size_t cls, Npc &owner) |
| void | unequip (Item *cls, Npc &owner) |
| void | invalidateCond (Npc &owner) |
| void | autoEquipWeapons (Npc &owner) |
| void | equipArmor (int32_t cls, Npc &owner) |
| void | equipBestArmor (Npc &owner) |
| void | equipBestMeleeWeapon (Npc &owner) |
| void | equipBestRangedWeapon (Npc &owner) |
| void | unequipWeapons (GameScript &vm, Npc &owner) |
| void | unequipArmor (GameScript &vm, Npc &owner) |
| void | clear (GameScript &vm, Npc &owner, bool includeMissionItm=false) |
| void | clear (GameScript &vm, Interactive &owner, bool includeMissionItm=false) |
| bool | hasSpell (int32_t spl) const |
| bool | hasMissionItems () const |
| bool | hasRangedWeaponWithAmmo () const |
| void | updateArmorView (Npc &owner) |
| void | updateSwordView (Npc &owner) |
| void | updateBowView (Npc &owner) |
| void | updateShieldView (Npc &owner) |
| void | updateRuneView (Npc &owner) |
| void | updateView (Npc &owner) |
| const Item * | activeWeapon () const |
| Item * | activeWeapon () |
| void | switchActiveWeaponFist () |
| void | switchActiveWeapon (Npc &owner, uint8_t slot) |
| void | switchActiveSpell (int32_t spell, Npc &owner) |
| Item * | currentArmor () |
| Item * | currentMeleeWeapon () |
| Item * | currentRangedWeapon () |
| Item * | currentShield () |
| Item * | currentSpell (uint8_t s) |
| const Item * | currentSpell (uint8_t s) const |
| Item * | findByFlags (ItmFlags f, uint32_t num) const |
| uint8_t | currentSpellSlot () const |
| bool | hasStateItem () const |
| void | putCurrentToSlot (Npc &owner, std::string_view slot) |
| void | putToSlot (Npc &owner, size_t cls, std::string_view slot) |
| bool | clearSlot (Npc &owner, std::string_view slot, bool remove) |
| void | putAmmunition (Npc &owner, size_t cls, std::string_view slot) |
| bool | putState (Npc &owner, size_t cls, int state) |
| void | setCurrentItem (size_t cls) |
| void | setStateItem (size_t cls) |
Static Public Member Functions | |
| static void | transfer (Inventory &to, Inventory &from, Npc *fromNpc, size_t cls, size_t count, World &wrld) |
| static void | moveItem (Npc &owner, Inventory &invNpc, Interactive &mobsi) |
Definition at line 17 of file inventory.h.
| enum Inventory::IteratorType : uint8_t |
| Enumerator | |
|---|---|
| T_Inventory | |
| T_Trade | |
| T_Ransack | |
Definition at line 30 of file inventory.h.
| Inventory::Inventory | ( | ) |
Definition at line 84 of file inventory.cpp.
|
default |
| Inventory::~Inventory | ( | ) |
Definition at line 87 of file inventory.cpp.
| Item * Inventory::activeWeapon | ( | ) |
Definition at line 616 of file inventory.cpp.
| const Item * Inventory::activeWeapon | ( | ) | const |
Definition at line 596 of file inventory.cpp.
Definition at line 251 of file inventory.cpp.
Definition at line 243 of file inventory.cpp.
Definition at line 223 of file inventory.cpp.
| void Inventory::autoEquipWeapons | ( | Npc & | owner | ) |
Definition at line 936 of file inventory.cpp.
| void Inventory::clear | ( | GameScript & | vm, |
| Interactive & | owner, | ||
| bool | includeMissionItm = false |
||
| ) |
Definition at line 573 of file inventory.cpp.
| void Inventory::clear | ( | GameScript & | vm, |
| Npc & | owner, | ||
| bool | includeMissionItm = false |
||
| ) |
Definition at line 564 of file inventory.cpp.
| bool Inventory::clearSlot | ( | Npc & | owner, |
| std::string_view | slot, | ||
| bool | remove | ||
| ) |
Definition at line 716 of file inventory.cpp.
|
inline |
Definition at line 105 of file inventory.h.
|
inline |
Definition at line 106 of file inventory.h.
|
inline |
Definition at line 107 of file inventory.h.
|
inline |
Definition at line 108 of file inventory.h.
|
inline |
Definition at line 109 of file inventory.h.
|
inline |
Definition at line 110 of file inventory.h.
| uint8_t Inventory::currentSpellSlot | ( | ) | const |
Definition at line 671 of file inventory.cpp.
| void Inventory::delItem | ( | size_t | cls, |
| size_t | count, | ||
| Npc & | owner | ||
| ) |
Definition at line 274 of file inventory.cpp.
| bool Inventory::equip | ( | size_t | cls, |
| Npc & | owner, | ||
| bool | force | ||
| ) |
Definition at line 908 of file inventory.cpp.
| void Inventory::equipArmor | ( | int32_t | cls, |
| Npc & | owner | ||
| ) |
Definition at line 943 of file inventory.cpp.
| void Inventory::equipBestArmor | ( | Npc & | owner | ) |
Definition at line 955 of file inventory.cpp.
| void Inventory::equipBestMeleeWeapon | ( | Npc & | owner | ) |
Definition at line 542 of file inventory.cpp.
| void Inventory::equipBestRangedWeapon | ( | Npc & | owner | ) |
Definition at line 548 of file inventory.cpp.
Definition at line 970 of file inventory.cpp.
| Item * Inventory::getItem | ( | size_t | instance | ) |
Definition at line 341 of file inventory.cpp.
| size_t Inventory::goldCount | ( | ) | const |
Definition at line 209 of file inventory.cpp.
| bool Inventory::hasMissionItems | ( | ) | const |
Definition at line 589 of file inventory.cpp.
| bool Inventory::hasRangedWeaponWithAmmo | ( | ) | const |
Definition at line 602 of file inventory.cpp.
| bool Inventory::hasSpell | ( | int32_t | spl | ) | const |
Definition at line 582 of file inventory.cpp.
| bool Inventory::hasStateItem | ( | ) | const |
Definition at line 679 of file inventory.cpp.
| void Inventory::invalidateCond | ( | Npc & | owner | ) |
Definition at line 915 of file inventory.cpp.
| bool Inventory::isEmpty | ( | ) | const |
Definition at line 90 of file inventory.cpp.
| size_t Inventory::itemCount | ( | const size_t | id | ) | const |
Definition at line 216 of file inventory.cpp.
| Inventory::Iterator Inventory::iterator | ( | IteratorType | t | ) | const |
Definition at line 191 of file inventory.cpp.
| void Inventory::load | ( | Serialize & | s, |
| Interactive & | owner, | ||
| World & | w | ||
| ) |
Definition at line 150 of file inventory.cpp.
Definition at line 146 of file inventory.cpp.
|
static |
Definition at line 785 of file inventory.cpp.
| int32_t Inventory::priceOf | ( | size_t | item | ) | const |
Definition at line 195 of file inventory.cpp.
| void Inventory::putAmmunition | ( | Npc & | owner, |
| size_t | cls, | ||
| std::string_view | slot | ||
| ) |
Definition at line 739 of file inventory.cpp.
| void Inventory::putCurrentToSlot | ( | Npc & | owner, |
| std::string_view | slot | ||
| ) |
Definition at line 683 of file inventory.cpp.
| bool Inventory::putState | ( | Npc & | owner, |
| size_t | cls, | ||
| int | state | ||
| ) |
Definition at line 770 of file inventory.cpp.
| void Inventory::putToSlot | ( | Npc & | owner, |
| size_t | cls, | ||
| std::string_view | slot | ||
| ) |
Definition at line 693 of file inventory.cpp.
| void Inventory::save | ( | Serialize & | s | ) | const |
Definition at line 154 of file inventory.cpp.
| int32_t Inventory::sellPriceOf | ( | size_t | item | ) | const |
Definition at line 202 of file inventory.cpp.
| void Inventory::setCurrentItem | ( | size_t | cls | ) |
Definition at line 809 of file inventory.cpp.
| void Inventory::setStateItem | ( | size_t | cls | ) |
Definition at line 813 of file inventory.cpp.
| void Inventory::switchActiveSpell | ( | int32_t | spell, |
| Npc & | owner | ||
| ) |
Definition at line 652 of file inventory.cpp.
| void Inventory::switchActiveWeapon | ( | Npc & | owner, |
| uint8_t | slot | ||
| ) |
Definition at line 628 of file inventory.cpp.
| void Inventory::switchActiveWeaponFist | ( | ) |
Definition at line 622 of file inventory.cpp.
|
static |
Definition at line 312 of file inventory.cpp.
Definition at line 353 of file inventory.cpp.
| bool Inventory::unequip | ( | size_t | cls, |
| Npc & | owner | ||
| ) |
Definition at line 345 of file inventory.cpp.
| void Inventory::unequipArmor | ( | GameScript & | vm, |
| Npc & | owner | ||
| ) |
Definition at line 560 of file inventory.cpp.
| void Inventory::unequipWeapons | ( | GameScript & | vm, |
| Npc & | owner | ||
| ) |
Definition at line 554 of file inventory.cpp.
| void Inventory::updateArmorView | ( | Npc & | owner | ) |
Definition at line 484 of file inventory.cpp.
| void Inventory::updateBowView | ( | Npc & | owner | ) |
Definition at line 504 of file inventory.cpp.
| void Inventory::updateRuneView | ( | Npc & | owner | ) |
Definition at line 530 of file inventory.cpp.
| void Inventory::updateShieldView | ( | Npc & | owner | ) |
Definition at line 517 of file inventory.cpp.
| void Inventory::updateSwordView | ( | Npc & | owner | ) |
Definition at line 494 of file inventory.cpp.
| void Inventory::updateView | ( | Npc & | owner | ) |
Definition at line 461 of file inventory.cpp.
| bool Inventory::use | ( | size_t | cls, |
| Npc & | owner, | ||
| uint8_t | slotHint, | ||
| bool | force | ||
| ) |
Definition at line 838 of file inventory.cpp.