OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
Item Class Reference

#include <item.h>

Inheritance diagram for Item:
Vob ItemTorchBurning

Public Types

enum  { MAX_UI_ROWS =6 , NSLOT =255 }
 
enum  Type : uint8_t { T_World , T_WorldDyn , T_Inventory }
 
- Public Types inherited from Vob
enum  Flags : uint8_t { None = 0 , Startup = 0x1 << 0 , Static = 0x1 << 1 }
 

Public Member Functions

 Item (World &owner, size_t inst, Type type)
 
 Item (World &owner, Serialize &fin, Type type)
 
 Item (Item &&)
 
 ~Item ()
 
Itemoperator= (Item &&)=delete
 
void save (Serialize &fout) const override
 
virtual void clearView ()
 
virtual bool isTorchBurn () const
 
void setPosition (float x, float y, float z)
 
void setDirection (float x, float y, float z)
 
void setObjMatrix (const Tempest::Matrix4x4 &m)
 
bool isMission () const
 
bool isEquipped () const
 
uint8_t equipCount () const
 
void setAsEquipped (bool e)
 
void setPhysicsEnable (World &w)
 
void setPhysicsDisable ()
 
bool isDynamic () const override
 
uint8_t slot () const
 
void setSlot (uint8_t s)
 
std::string_view displayName () const
 
std::string_view description () const
 
Tempest::Vec3 position () const
 
Tempest::Vec3 midPosition () const
 
bool isGold () const
 
ItmFlags mainFlag () const
 
int32_t itemFlag () const
 
bool isMulti () const
 
bool is2H () const
 
bool isCrossbow () const
 
bool isRing () const
 
bool isArmor () const
 
bool isSpellShoot () const
 
bool isSpellOrRune () const
 
bool isSpell () const
 
bool isRune () const
 
int32_t spellId () const
 
int32_t swordLength () const
 
void setCount (size_t cnt)
 
size_t count () const
 
std::string_view uiText (size_t id) const
 
int32_t uiValue (size_t id) const
 
int32_t cost () const
 
int32_t sellCost () const
 
bool checkCond (const Npc &other) const
 
bool checkCondUse (const Npc &other, int32_t &atr, int32_t &nv) const
 
bool checkCondRune (const Npc &other, int32_t &cPl, int32_t &cIt) const
 
const zenkit::IItem & handle () const
 
zenkit::IItem & handle ()
 
const std::shared_ptr< zenkit::IItem > & handlePtr ()
 
size_t clsId () const
 
- Public Member Functions inherited from Vob
 Vob (World &owner)
 
 Vob (Vob *parent, World &owner, const zenkit::VirtualObject &vob, Flags flags)
 
virtual ~Vob ()
 
void saveVobTree (Serialize &fin) const
 
void loadVobTree (Serialize &fin)
 
virtual void load (Serialize &fin)
 
Tempest::Vec3 position () const
 
auto transform () const -> const Tempest::Matrix4x4 &
 
void setGlobalTransform (const Tempest::Matrix4x4 &p)
 
auto localTransform () const -> const Tempest::Matrix4x4 &
 
void setLocalTransform (const Tempest::Matrix4x4 &p)
 
virtual bool setMobState (std::string_view scheme, int32_t st)
 
virtual float extendedSearchRadius () const
 

Protected Member Functions

void moveEvent () override
 
void setPhysicsEnable (const MeshObjects::Mesh &mesh)
 
void setPhysicsEnable (const ProtoMesh *mesh)
 

Additional Inherited Members

- Static Public Member Functions inherited from Vob
static std::unique_ptr< Vobload (Vob *parent, World &world, const zenkit::VirtualObject &vob, Flags flags)
 
- Protected Attributes inherited from Vob
Worldworld
 
zenkit::VirtualObjectType vobType = zenkit::VirtualObjectType::UNKNOWN
 
uint32_t vobObjectID = uint32_t(-1)
 

Detailed Description

Definition at line 14 of file item.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_UI_ROWS 
NSLOT 

Definition at line 16 of file item.h.

◆ Type

enum Item::Type : uint8_t
Enumerator
T_World 
T_WorldDyn 
T_Inventory 

Definition at line 18 of file item.h.

Constructor & Destructor Documentation

◆ Item() [1/3]

Item::Item ( World owner,
size_t  inst,
Type  type 
)

Definition at line 14 of file item.cpp.

◆ Item() [2/3]

Item::Item ( World owner,
Serialize fin,
Type  type 
)

Definition at line 29 of file item.cpp.

◆ Item() [3/3]

Item::Item ( Item &&  it)

Definition at line 74 of file item.cpp.

◆ ~Item()

Item::~Item ( )

Definition at line 81 of file item.cpp.

Member Function Documentation

◆ checkCond()

bool Item::checkCond ( const Npc other) const

Definition at line 290 of file item.cpp.

◆ checkCondRune()

bool Item::checkCondRune ( const Npc other,
int32_t &  cPl,
int32_t &  cIt 
) const

Definition at line 307 of file item.cpp.

◆ checkCondUse()

bool Item::checkCondUse ( const Npc other,
int32_t &  atr,
int32_t &  nv 
) const

Definition at line 295 of file item.cpp.

◆ clearView()

void Item::clearView ( )
virtual

Reimplemented in ItemTorchBurning.

Definition at line 101 of file item.cpp.

◆ clsId()

size_t Item::clsId ( ) const

Definition at line 313 of file item.cpp.

◆ cost()

int32_t Item::cost ( ) const

Definition at line 282 of file item.cpp.

◆ count()

size_t Item::count ( ) const

Definition at line 270 of file item.cpp.

◆ description()

std::string_view Item::description ( ) const

Definition at line 176 of file item.cpp.

◆ displayName()

std::string_view Item::displayName ( ) const

Definition at line 172 of file item.cpp.

◆ equipCount()

uint8_t Item::equipCount ( ) const
inline

Definition at line 41 of file item.h.

◆ handle() [1/2]

zenkit::IItem & Item::handle ( )
inline

Definition at line 84 of file item.h.

◆ handle() [2/2]

const zenkit::IItem & Item::handle ( ) const
inline

Definition at line 83 of file item.h.

◆ handlePtr()

const std::shared_ptr< zenkit::IItem > & Item::handlePtr ( )
inline

Definition at line 85 of file item.h.

◆ is2H()

bool Item::is2H ( ) const

Definition at line 238 of file item.cpp.

◆ isArmor()

bool Item::isArmor ( ) const

Definition at line 253 of file item.cpp.

◆ isCrossbow()

bool Item::isCrossbow ( ) const

Definition at line 243 of file item.cpp.

◆ isDynamic()

bool Item::isDynamic ( ) const
overridevirtual

Reimplemented from Vob.

Definition at line 168 of file item.cpp.

◆ isEquipped()

bool Item::isEquipped ( ) const
inline

Definition at line 40 of file item.h.

◆ isGold()

bool Item::isGold ( ) const

Definition at line 191 of file item.cpp.

◆ isMission()

bool Item::isMission ( ) const

Definition at line 125 of file item.cpp.

◆ isMulti()

bool Item::isMulti ( ) const

Definition at line 203 of file item.cpp.

◆ isRing()

bool Item::isRing ( ) const

Definition at line 248 of file item.cpp.

◆ isRune()

bool Item::isRune ( ) const

Definition at line 234 of file item.cpp.

◆ isSpell()

bool Item::isSpell ( ) const

Definition at line 228 of file item.cpp.

◆ isSpellOrRune()

bool Item::isSpellOrRune ( ) const

Definition at line 224 of file item.cpp.

◆ isSpellShoot()

bool Item::isSpellShoot ( ) const

Definition at line 207 of file item.cpp.

◆ isTorchBurn()

bool Item::isTorchBurn ( ) const
virtual

Reimplemented in ItemTorchBurning.

Definition at line 105 of file item.cpp.

◆ itemFlag()

int32_t Item::itemFlag ( ) const

Definition at line 199 of file item.cpp.

◆ mainFlag()

ItmFlags Item::mainFlag ( ) const

Definition at line 195 of file item.cpp.

◆ midPosition()

Vec3 Item::midPosition ( ) const

Definition at line 184 of file item.cpp.

◆ moveEvent()

void Item::moveEvent ( )
overrideprotectedvirtual

Reimplemented from Vob.

Reimplemented in ItemTorchBurning.

Definition at line 324 of file item.cpp.

◆ operator=()

Item & Item::operator= ( Item &&  )
delete

◆ position()

Tempest::Vec3 Item::position ( ) const

Definition at line 180 of file item.cpp.

◆ save()

void Item::save ( Serialize fout) const
overridevirtual

Reimplemented from Vob.

Definition at line 84 of file item.cpp.

◆ sellCost()

int32_t Item::sellCost ( ) const

Definition at line 286 of file item.cpp.

◆ setAsEquipped()

void Item::setAsEquipped ( bool  e)

Definition at line 129 of file item.cpp.

◆ setCount()

void Item::setCount ( size_t  cnt)

Definition at line 266 of file item.cpp.

◆ setDirection()

void Item::setDirection ( float  x,
float  y,
float  z 
)

Definition at line 114 of file item.cpp.

◆ setObjMatrix()

void Item::setObjMatrix ( const Tempest::Matrix4x4 &  m)

Definition at line 117 of file item.cpp.

◆ setPhysicsDisable()

void Item::setPhysicsDisable ( )

Definition at line 145 of file item.cpp.

◆ setPhysicsEnable() [1/3]

void Item::setPhysicsEnable ( const MeshObjects::Mesh mesh)
protected

Definition at line 150 of file item.cpp.

◆ setPhysicsEnable() [2/3]

void Item::setPhysicsEnable ( const ProtoMesh mesh)
protected

Definition at line 158 of file item.cpp.

◆ setPhysicsEnable() [3/3]

void Item::setPhysicsEnable ( World w)

Definition at line 140 of file item.cpp.

◆ setPosition()

void Item::setPosition ( float  x,
float  y,
float  z 
)

Definition at line 109 of file item.cpp.

◆ setSlot()

void Item::setSlot ( uint8_t  s)
inline

Definition at line 49 of file item.h.

◆ slot()

uint8_t Item::slot ( ) const
inline

Definition at line 48 of file item.h.

◆ spellId()

int32_t Item::spellId ( ) const

Definition at line 258 of file item.cpp.

◆ swordLength()

int32_t Item::swordLength ( ) const

Definition at line 262 of file item.cpp.

◆ uiText()

std::string_view Item::uiText ( size_t  id) const

Definition at line 274 of file item.cpp.

◆ uiValue()

int32_t Item::uiValue ( size_t  id) const

Definition at line 278 of file item.cpp.


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