ManaPlus
Public Member Functions
EAthena::RefineHandler Class Reference

#include <refinehandler.h>

Inheritance diagram for EAthena::RefineHandler:
Net::RefineHandler

Public Member Functions

 RefineHandler ()
 
 ~RefineHandler ()
 
void addItem (const Item *const item) const
 
void refineItem (const Item *const item1, const Item *const item2, const int blessing) const
 
void close () const
 
- Public Member Functions inherited from Net::RefineHandler
 RefineHandler ()
 

Detailed Description

Definition at line 29 of file refinehandler.h.

Constructor & Destructor Documentation

◆ RefineHandler()

EAthena::RefineHandler::RefineHandler ( )

Definition at line 34 of file refinehandler.cpp.

34  :
36 {
37  refineHandler = this;
38 }
Net::RefineHandler * refineHandler
Definition: net.cpp:119

References refineHandler.

◆ ~RefineHandler()

EAthena::RefineHandler::~RefineHandler ( )
virtual

Reimplemented from Net::RefineHandler.

Definition at line 40 of file refinehandler.cpp.

41 {
42  refineHandler = nullptr;
43 }

References refineHandler.

Member Function Documentation

◆ addItem()

void EAthena::RefineHandler::addItem ( const Item *const  item) const
virtual

Implements Net::RefineHandler.

Definition at line 45 of file refinehandler.cpp.

46 {
47  if (item == nullptr)
48  return;
49  createOutPacket(CMSG_REFINE_ADD_ITEM);
50  outMsg.writeInt16(CAST_S16(
51  item->getInvIndex() + INVENTORY_OFFSET), "inv index");
52 }
#define CAST_S16
Definition: cast.h:28
int getInvIndex() const
Definition: item.h:165
static const int INVENTORY_OFFSET
Definition: inventory.h:27
#define createOutPacket(name)
Definition: messageout.h:37

References CAST_S16, createOutPacket, Item::getInvIndex(), and INVENTORY_OFFSET.

◆ close()

void EAthena::RefineHandler::close ( ) const
virtual

Implements Net::RefineHandler.

Definition at line 70 of file refinehandler.cpp.

71 {
72  createOutPacket(CMSG_REFINE_CLOSE);
73 }

References createOutPacket.

◆ refineItem()

void EAthena::RefineHandler::refineItem ( const Item *const  item1,
const Item *const  item2,
const int  blessing 
) const
virtual

Implements Net::RefineHandler.

Definition at line 54 of file refinehandler.cpp.

57 {
58  if (item1 == nullptr ||
59  item2 == nullptr)
60  {
61  return;
62  }
63  createOutPacket(CMSG_REFINE_ITEM);
64  outMsg.writeInt16(CAST_S16(
65  item1->getInvIndex() + INVENTORY_OFFSET), "inv index");
66  outMsg.writeItemId(item2->getId(), "item id");
67  outMsg.writeInt8(blessing, "blessing");
68 }
int getId() const
Definition: item.h:81

References CAST_S16, createOutPacket, Item::getId(), Item::getInvIndex(), and INVENTORY_OFFSET.


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