Argentum Online - Servidor
merchant.h
1 #ifndef MERCHANT_H
2 #define MERCHANT_H
3 
4 #include "../items/item_container.h"
5 #include "npc.h"
6 #include "player.h"
7 
8 #define MERCH_SLOTS_INV 10
9 
10 class Merchant : public Npc {
11  private:
13 
14  public:
15  Merchant(EntityId entity_id, nlohmann::json npc_info, Map& map);
16  ~Merchant();
30  void sell(SlotId slot, uint32_t stack, Player* player);
42  void buy(SlotId slot, uint32_t stack, Player* player);
49  const std::string list_sale() const;
50 };
51 
52 #endif // MERCHANT_H
inventory
Definition: item_container.h:32
Merchant::list_sale
const std::string list_sale() const
Devuelve un string que representa la lista de los items que tiene el comerciante para vender,...
Definition: merchant.cpp:24
ItemContainer
Definition: item_container.h:50
Merchant
Definition: merchant.h:10
Merchant::sell
void sell(SlotId slot, uint32_t stack, Player *player)
Vende el item del inventario del player que se encuentra en el SlotId slot, en caso de no haber,...
Definition: merchant.cpp:52
Merchant::buy
void buy(SlotId slot, uint32_t stack, Player *player)
Compra del item del inventario del npc que se encuentra en el SlotID slot, en caso de no haber,...
Definition: merchant.cpp:86
Npc
Definition: npc.h:10
player.h
Map
Definition: map.h:47
Player
Definition: player.h:14