ManaPlus
Data Structures | Public Member Functions | Private Attributes
Equipment Class Reference

#include <equipment.h>

Data Structures

class  Backend
 

Public Member Functions

 Equipment ()
 
 ~Equipment ()
 
const ItemgetEquipment (const int index) const
 
void clear ()
 
void setEquipment (int index, int id, int quantity=0)
 
void setBackend (Backend *const backend)
 
const BackendgetBackend () const
 

Private Attributes

BackendmBackend
 

Detailed Description

Definition at line 30 of file equipment.h.

Constructor & Destructor Documentation

◆ Equipment()

Equipment::Equipment ( )
inline

Constructor.

Definition at line 36 of file equipment.h.

References A_DELETE_COPY.

36  :
37  mBackend(nullptr)
38  { }
Backend * mBackend
Definition: equipment.h:92

◆ ~Equipment()

Equipment::~Equipment ( )
inline

Destructor.

Definition at line 45 of file equipment.h.

References mBackend.

46  { mBackend = nullptr; }
Backend * mBackend
Definition: equipment.h:92

Member Function Documentation

◆ clear()

void Equipment::clear ( )
inline

Clears equipment.

Definition at line 77 of file equipment.h.

References Equipment::Backend::clear(), mBackend, and setEquipment().

Referenced by PlayerInfo::clearInventory().

78  { if (mBackend != nullptr) mBackend->clear(); }
Backend * mBackend
Definition: equipment.h:92
virtual void clear()=0

◆ getBackend()

const Backend* Equipment::getBackend ( ) const
inline

◆ getEquipment()

const Item* Equipment::getEquipment ( const int  index) const
inline

Get equipment at the given slot.

Definition at line 68 of file equipment.h.

References Equipment::Backend::getEquipment(), and mBackend.

Referenced by EquipmentWindow::action(), EquipmentWindow::draw(), EquipmentWindow::getEquipment(), PlayerInfo::getEquipment(), EquipmentWindow::getItem(), EquipmentWindow::mousePressed(), and EquipmentWindow::safeDraw().

69  {
70  return mBackend != nullptr ?
71  mBackend->getEquipment(index) : nullptr;
72  }
Backend * mBackend
Definition: equipment.h:92
virtual const Item * getEquipment(const int index) const =0

◆ setBackend()

void Equipment::setBackend ( Backend *const  backend)
inline

◆ setEquipment()

void Equipment::setEquipment ( int  index,
int  id,
int  quantity = 0 
)

Set equipment at the given slot.

Referenced by clear().

Field Documentation

◆ mBackend

Backend* Equipment::mBackend
private

Definition at line 92 of file equipment.h.

Referenced by clear(), getBackend(), getEquipment(), setBackend(), and ~Equipment().


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