the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 42 lines 1.2 kB view raw
1#pragma once 2 3class Container; 4 5class Slot 6{ 7private: 8 int slot; 9 10public: 11 shared_ptr<Container> container; 12 13public: 14 int index; 15 int x, y; 16 17 Slot(shared_ptr<Container> container, int slot, int x, int y); 18 virtual ~Slot() {} 19 20 void onQuickCraft(shared_ptr<ItemInstance> picked, shared_ptr<ItemInstance> original); 21 22protected: 23 virtual void onQuickCraft(shared_ptr<ItemInstance> picked, int count); 24 virtual void checkTakeAchievements(shared_ptr<ItemInstance> picked); 25 26public: 27 void swap(Slot *other); 28 virtual void onTake(shared_ptr<Player> player, shared_ptr<ItemInstance> carried); 29 virtual bool mayPlace(shared_ptr<ItemInstance> item); 30 virtual shared_ptr<ItemInstance> getItem(); 31 virtual bool hasItem(); 32 virtual void set(shared_ptr<ItemInstance> item); 33 virtual void setChanged(); 34 virtual int getMaxStackSize() const; 35 virtual Icon *getNoItemIcon(); 36 virtual shared_ptr<ItemInstance> remove(int c); 37 virtual bool isAt(shared_ptr<Container> c, int s); 38 virtual bool mayPickup(shared_ptr<Player> player); 39 virtual bool isActive(); 40 virtual bool mayCombine(shared_ptr<ItemInstance> item); // 4J Added 41 virtual shared_ptr<ItemInstance> combine(shared_ptr<ItemInstance> item); // 4J Added 42};