4jcraft/Minecraft.World/Containers/MerchantContainer.h
Tropical f25cd66f4d TU19: merge Minecraft.World/Containers
keeping virtual destructors where possible
2026-03-21 15:18:52 -05:00

45 lines
1.2 KiB
C++

#pragma once
#include "Container.h"
#include "../Util/ArrayWithLength.h"
class Merchant;
class Player;
class MerchantRecipe;
class MerchantContainer : public Container {
private:
std::shared_ptr<Merchant> merchant;
ItemInstanceArray items;
std::shared_ptr<Player> player;
MerchantRecipe* activeRecipe;
int selectionHint;
public:
MerchantContainer(std::shared_ptr<Player> player,
std::shared_ptr<Merchant> villager);
~MerchantContainer();
unsigned int getContainerSize();
std::shared_ptr<ItemInstance> getItem(unsigned int slot);
std::shared_ptr<ItemInstance> removeItem(unsigned int slot, int count);
private:
bool isPaymentSlot(int slot);
public:
std::shared_ptr<ItemInstance> removeItemNoUpdate(int slot);
void setItem(unsigned int slot, std::shared_ptr<ItemInstance> item);
std::wstring getName();
std::wstring getCustomName();
bool hasCustomName();
int getMaxStackSize();
bool stillValid(std::shared_ptr<Player> player);
void startOpen();
void stopOpen();
bool canPlaceItem(int slot, std::shared_ptr<ItemInstance> item);
void setChanged();
void updateSellItem();
MerchantRecipe* getActiveRecipe();
void setSelectionHint(int selectionHint);
};