2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Slot.h"
|
|
|
|
|
|
|
|
|
|
class MerchantContainer;
|
|
|
|
|
class Player;
|
|
|
|
|
class Merchant;
|
|
|
|
|
|
|
|
|
|
class MerchantResultSlot : public Slot
|
|
|
|
|
{
|
|
|
|
|
private:
|
2026-03-02 15:58:20 +07:00
|
|
|
std::shared_ptr<MerchantContainer> slots;
|
2026-03-01 12:16:08 +08:00
|
|
|
Player *player;
|
|
|
|
|
int removeCount;
|
2026-03-02 15:58:20 +07:00
|
|
|
std::shared_ptr<Merchant> merchant;
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
2026-03-02 15:58:20 +07:00
|
|
|
MerchantResultSlot(Player *player, std::shared_ptr<Merchant> merchant, std::shared_ptr<MerchantContainer> slots, int id, int x, int y);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-02 15:58:20 +07:00
|
|
|
bool mayPlace(std::shared_ptr<ItemInstance> item);
|
|
|
|
|
std::shared_ptr<ItemInstance> remove(int c);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
protected:
|
2026-03-02 15:58:20 +07:00
|
|
|
void onQuickCraft(std::shared_ptr<ItemInstance> picked, int count);
|
|
|
|
|
void checkTakeAchievements(std::shared_ptr<ItemInstance> carried);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
2026-03-02 15:58:20 +07:00
|
|
|
void onTake(std::shared_ptr<Player> player, std::shared_ptr<ItemInstance> carried);
|
|
|
|
|
virtual bool mayCombine(std::shared_ptr<ItemInstance> item); // 4J Added
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
private:
|
2026-03-02 15:58:20 +07:00
|
|
|
bool removePaymentItemsIfMatching(MerchantRecipe *activeRecipe, std::shared_ptr<ItemInstance> a, std::shared_ptr<ItemInstance> b);
|
2026-03-01 12:16:08 +08:00
|
|
|
};
|