Files
MinecraftConsoles/Minecraft.World/MerchantRecipeList.h
void_17 7074f35e4b shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
2026-03-02 15:58:20 +07:00

35 lines
1.1 KiB
C++

#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(std::shared_ptr<ItemInstance> buyA, std::shared_ptr<ItemInstance> buyB, int selectionHint);
bool addIfNewOrBetter(MerchantRecipe *recipe); // 4J Added bool return
MerchantRecipe *getMatchingRecipeFor(std::shared_ptr<ItemInstance> buy, std::shared_ptr<ItemInstance> buyB, std::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();
};