the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 35 lines 1.1 kB view raw
1#pragma once 2#include <vector> 3 4class MerchantRecipe; 5class CompoundTag; 6class ItemInstance; 7class DataOutputStream; 8class DataInputStream; 9 10class MerchantRecipeList 11{ 12private: 13 std::vector<MerchantRecipe *> m_recipes; 14 15public: 16 MerchantRecipeList(); 17 MerchantRecipeList(CompoundTag *tag); 18 ~MerchantRecipeList(); 19 20 MerchantRecipe *getRecipeFor(shared_ptr<ItemInstance> buyA, shared_ptr<ItemInstance> buyB, int selectionHint); 21 bool addIfNewOrBetter(MerchantRecipe *recipe); // 4J Added bool return 22 MerchantRecipe *getMatchingRecipeFor(shared_ptr<ItemInstance> buy, shared_ptr<ItemInstance> buyB, shared_ptr<ItemInstance> sell); 23 void writeToStream(DataOutputStream *stream); 24 static MerchantRecipeList *createFromStream(DataInputStream *stream); 25 void load(CompoundTag *tag); 26 CompoundTag *createTag(); 27 28 void push_back(MerchantRecipe *recipe); 29 MerchantRecipe *at(size_t index); 30 std::vector<MerchantRecipe *>::iterator begin(); 31 std::vector<MerchantRecipe *>::iterator end(); 32 std::vector<MerchantRecipe *>::iterator erase(std::vector<MerchantRecipe *>::iterator it); 33 size_t size(); 34 bool empty(); 35};