blob: 9f4efe33837bede3be785be0ebfd9b03b519dddf (
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
|
#pragma once
#include "Container.h"
#include "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);
int getName();
int getMaxStackSize();
bool stillValid(std::shared_ptr<Player> player);
void startOpen();
void stopOpen();
void setChanged();
void updateSellItem();
MerchantRecipe *getActiveRecipe();
void setSelectionHint(int selectionHint);
};
|