aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MerchantContainer.h
blob: e2e639702d13b7fb3d19963b3e0b23b8703ff888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include "Container.h"
#include "ArrayWithLength.h"

class Merchant;
class Player;
class MerchantRecipe;

class MerchantContainer : public Container
{
private:
	shared_ptr<Merchant> merchant;
	ItemInstanceArray items;
	shared_ptr<Player> player;
	MerchantRecipe *activeRecipe;
	int selectionHint;

public:
	MerchantContainer(shared_ptr<Player> player, shared_ptr<Merchant> villager);
	~MerchantContainer();

	unsigned int getContainerSize();
	shared_ptr<ItemInstance> getItem(unsigned int slot);
	shared_ptr<ItemInstance> removeItem(unsigned int slot, int count);

private:
	bool isPaymentSlot(int slot);

public:
	shared_ptr<ItemInstance> removeItemNoUpdate(int slot);
	void setItem(unsigned int slot, shared_ptr<ItemInstance> item);
	wstring getName();
	wstring getCustomName();
	bool hasCustomName();
	int getMaxStackSize() const;
	bool stillValid(shared_ptr<Player> player);
	void startOpen();
	void stopOpen();
	bool canPlaceItem(int slot, shared_ptr<ItemInstance> item);
	void setChanged();
	void updateSellItem();
	MerchantRecipe *getActiveRecipe();
	void setSelectionHint(int selectionHint);
};