65 outMsg.writeBeingId(being->
getId(),
"account id");
70 const int amount)
const
76 outMsg.writeInt16(12,
"len");
77 outMsg.writeBeingId(being->
getId(),
"account id");
78 outMsg.writeInt16(
CAST_S16(amount),
"amount");
79 outMsg.writeInt16(
CAST_S16(index),
"index");
83 const STD_VECTOR<ShopItem*> &items)
const
86 const int pairSize = 4;
88 FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
92 if (usedQuantity == 0)
101 outMsg.writeInt16(
CAST_S16(4 + 4 + pairSize * cnt),
"len");
102 outMsg.writeBeingId(being->
getId(),
"account id");
103 FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
107 if (usedQuantity == 0)
112 outMsg.writeInt16(
CAST_S16(usedQuantity),
"amount");
120 const int amount)
const
122 if (being ==
nullptr)
126 outMsg.writeInt16(16,
"len");
127 outMsg.writeBeingId(being->
getId(),
"account id");
128 outMsg.writeInt32(vendId,
"vend id");
129 outMsg.writeInt16(
CAST_S16(amount),
"amount");
130 outMsg.writeInt16(
CAST_S16(index),
"index");
135 const STD_VECTOR<ShopItem*> &items)
const
138 outMsg.writeInt16(
CAST_S16(85 + items.size() * 8),
"len");
139 outMsg.writeString(name, 80,
"shop name");
140 outMsg.writeInt8(
CAST_S8(flag ? 1 : 0),
"flag");
141 FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
147 outMsg.writeInt32(item->
getPrice(),
"price");
void open(const Being *const being) const
void buy2(const Being *const being, const int vendId, const int index, const int amount) const
void buyItems(const Being *const being, const std::vector< ShopItem * > &items) const
void buy(const Being *const being, const int index, const int amount) const
void createShop(const std::string &name, const bool flag, const std::vector< ShopItem * > &items) const
void increaseQuantity(const int amount)
void increaseUsedQuantity(const int amount)
int getUsedQuantity() const
static const int INVENTORY_OFFSET
#define FOR_EACH(type, iter, array)
#define createOutPacket(name)
void enableVending(const bool b)
Net::VendingHandler * vendingHandler