aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MerchantRecipeList.h
blob: 4a761d398c9506a85c7c8d0968a66def4e756126 (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
#pragma once
#include <vector>

class MerchantRecipe;
class CompoundTag;
class ItemInstance;
class DataOutputStream;
class DataInputStream;

class MerchantRecipeList
{
private:
	std::vector<MerchantRecipe *> m_recipes;

public:
	MerchantRecipeList();
	MerchantRecipeList(CompoundTag *tag);
	~MerchantRecipeList();

	MerchantRecipe *getRecipeFor(shared_ptr<ItemInstance> buyA, shared_ptr<ItemInstance> buyB, int selectionHint);
	bool addIfNewOrBetter(MerchantRecipe *recipe); // 4J Added bool return
	MerchantRecipe *getMatchingRecipeFor(shared_ptr<ItemInstance> buy, shared_ptr<ItemInstance> buyB, shared_ptr<ItemInstance> sell);
	void writeToStream(DataOutputStream *stream);
	static MerchantRecipeList *createFromStream(DataInputStream *stream);
	void load(CompoundTag *tag);
	CompoundTag *createTag();

	void push_back(MerchantRecipe *recipe);
	MerchantRecipe *at(size_t index);
	std::vector<MerchantRecipe *>::iterator begin();
	std::vector<MerchantRecipe *>::iterator end();
	std::vector<MerchantRecipe *>::iterator erase(std::vector<MerchantRecipe *>::iterator it);
	size_t size();
	bool empty();
};