ManaPlus
Public Member Functions | Static Public Member Functions | Protected Member Functions
Ea::InventoryHandler Class Reference

#include <inventoryhandler.h>

Inheritance diagram for Ea::InventoryHandler:
Net::InventoryHandler EAthena::InventoryHandler TmwAthena::InventoryHandler

Public Member Functions

 ~InventoryHandler ()
 
void clear () const
 
bool canSplit (const Item *const item) const A_CONST
 
void splitItem (const Item *const item, const int amount) const
 
void moveItem (const int oldIndex, const int newIndex) const
 
size_t getSize (const InventoryTypeT type) const A_CONST
 
void destroyStorage () const
 
void forgotStorage () const
 
InventorygetStorage () const
 
- Public Member Functions inherited from Net::InventoryHandler
 InventoryHandler ()
 
virtual void equipItem (const Item *const item) const =0
 
virtual void unequipItem (const Item *const item) const =0
 
virtual void useItem (const Item *const item) const =0
 
virtual void useItem (const Item *const item, const int16_t useType) const =0
 
virtual void dropItem (const Item *const item, const int amount) const =0
 
virtual void closeStorage () const =0
 
virtual void moveItem2 (const InventoryTypeT source, const int slot, const int amount, const InventoryTypeT destination) const =0
 
virtual int convertFromServerSlot (const int eAthenaSlot) const =0
 
virtual void useCard (const Item *const item)=0
 
virtual void insertCard (const int cardIndex, const int itemIndex) const =0
 
virtual void favoriteItem (const Item *const item, const bool favorite) const =0
 
virtual void selectEgg (const Item *const item) const =0
 
virtual int getProjectileSlot () const =0
 
virtual int getItemIndex () const =0
 
virtual void selectCart (const BeingId accountId, const int type) const =0
 
virtual void identifyItem (const Item *const item) const =0
 
virtual void mergeItemsAck (const std::vector< Item * > &items) const =0
 
virtual void mergetItemsCancel () const =0
 
virtual void expandInventory () const =0
 
virtual void expandInventoryConfirm () const =0
 
virtual void expandInventoryReject () const =0
 

Static Public Member Functions

static void pushPickup (const BeingId floorId)
 

Protected Member Functions

 InventoryHandler ()
 

Detailed Description

Definition at line 38 of file inventoryhandler.h.

Constructor & Destructor Documentation

◆ ~InventoryHandler()

Ea::InventoryHandler::~InventoryHandler ( )
virtual

Reimplemented from Net::InventoryHandler.

Reimplemented in TmwAthena::InventoryHandler, and EAthena::InventoryHandler.

Definition at line 48 of file inventoryhandler.cpp.

49 {
50  if (storageWindow != nullptr)
51  {
53  storageWindow = nullptr;
54  }
55 
57 }
#define delete2(var)
Definition: delete2.h:25
InventoryWindow * storageWindow
Inventory * mStorage

References InventoryWindow::close(), delete2, Ea::InventoryRecv::mStorage, and storageWindow.

◆ InventoryHandler()

Ea::InventoryHandler::InventoryHandler ( )
protected

Member Function Documentation

◆ canSplit()

bool Ea::InventoryHandler::canSplit ( const Item *const  item) const
virtual

Implements Net::InventoryHandler.

Definition at line 64 of file inventoryhandler.cpp.

65 {
66  return false;
67 }

◆ clear()

void Ea::InventoryHandler::clear ( ) const
virtual

Implements Net::InventoryHandler.

Reimplemented in EAthena::InventoryHandler.

Definition at line 59 of file inventoryhandler.cpp.

60 {
62 }

References delete2, and Ea::InventoryRecv::mStorage.

Referenced by EAthena::InventoryHandler::clear().

◆ destroyStorage()

void Ea::InventoryHandler::destroyStorage ( ) const
virtual

Implements Net::InventoryHandler.

Definition at line 102 of file inventoryhandler.cpp.

103 {
104  BLOCK_START("InventoryHandler::closeStorage")
105  if (storageWindow != nullptr)
106  {
107  InventoryWindow *const inv = storageWindow;
108  storageWindow->close();
109  inv->unsetInventory();
110  }
111  BLOCK_END("InventoryHandler::closeStorage")
112 }
if(!vert) return
#define BLOCK_END(name)
Definition: perfomance.h:80
#define BLOCK_START(name)
Definition: perfomance.h:79

References BLOCK_END, BLOCK_START, InventoryWindow::close(), storageWindow, and InventoryWindow::unsetInventory().

◆ forgotStorage()

void Ea::InventoryHandler::forgotStorage ( ) const
virtual

Implements Net::InventoryHandler.

Definition at line 114 of file inventoryhandler.cpp.

115 {
116  storageWindow = nullptr;
117 }

References storageWindow.

◆ getSize()

size_t Ea::InventoryHandler::getSize ( const InventoryTypeT  type) const
virtual

◆ getStorage()

Inventory * Ea::InventoryHandler::getStorage ( ) const
virtual

Implements Net::InventoryHandler.

Definition at line 124 of file inventoryhandler.cpp.

125 {
127 }

References Ea::InventoryRecv::mStorage.

◆ moveItem()

void Ea::InventoryHandler::moveItem ( const int  oldIndex,
const int  newIndex 
) const
virtual

Implements Net::InventoryHandler.

Definition at line 75 of file inventoryhandler.cpp.

77 {
78  // Not implemented for eAthena (possible?)
79 }

◆ pushPickup()

void Ea::InventoryHandler::pushPickup ( const BeingId  floorId)
static

Definition at line 119 of file inventoryhandler.cpp.

120 {
121  InventoryRecv::mSentPickups.push(floorId);
122 }

References Ea::InventoryRecv::mSentPickups.

Referenced by EAthena::PlayerHandler::pickUp(), and TmwAthena::PlayerHandler::pickUp().

◆ splitItem()

void Ea::InventoryHandler::splitItem ( const Item *const  item,
const int  amount 
) const
virtual

Implements Net::InventoryHandler.

Definition at line 69 of file inventoryhandler.cpp.

71 {
72  // Not implemented for eAthena (possible?)
73 }

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