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)
 
void setBackend (Backend *const backend)
 
const BackendgetBackend () const
 

Private Attributes

BackendmBackend
 

Detailed Description

Definition at line 31 of file equipment.h.

Constructor & Destructor Documentation

◆ Equipment()

Equipment::Equipment ( )
inline

Constructor.

Definition at line 37 of file equipment.h.

37  :
38  mBackend(nullptr)
39  { }
Backend * mBackend
Definition: equipment.h:95

◆ ~Equipment()

Equipment::~Equipment ( )
inline

Destructor.

Definition at line 46 of file equipment.h.

47  { mBackend = nullptr; }

References mBackend.

Member Function Documentation

◆ clear()

void Equipment::clear ( )
inline

Clears equipment.

Definition at line 78 of file equipment.h.

79  { if (mBackend != nullptr) mBackend->clear(); }
virtual void clear()=0

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

Referenced by PlayerInfo::clearInventory().

◆ 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 69 of file equipment.h.

70  {
71  return mBackend != nullptr ?
72  mBackend->getEquipment(index) : nullptr;
73  }
virtual const Item * getEquipment(const int index) const =0

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

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

◆ setBackend()

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

◆ setEquipment()

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

Set equipment at the given slot.

Field Documentation

◆ mBackend

Backend* Equipment::mBackend
private

Definition at line 95 of file equipment.h.

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


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