diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
| commit | 7074f35e4ba831e358117842b99ee35b87f85ae5 (patch) | |
| tree | 7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/AbstractContainerMenu.h | |
| parent | d63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff) | |
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.
Diffstat (limited to 'Minecraft.World/AbstractContainerMenu.h')
| -rw-r--r-- | Minecraft.World/AbstractContainerMenu.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Minecraft.World/AbstractContainerMenu.h b/Minecraft.World/AbstractContainerMenu.h index f34e1afc..0875d65c 100644 --- a/Minecraft.World/AbstractContainerMenu.h +++ b/Minecraft.World/AbstractContainerMenu.h @@ -26,7 +26,7 @@ public: static const int CONTAINER_ID_INVENTORY = 0; static const int CONTAINER_ID_CREATIVE = -2; - vector<shared_ptr<ItemInstance> > *lastSlots; + vector<std::shared_ptr<ItemInstance> > *lastSlots; vector<Slot *> *slots; int containerId; @@ -46,34 +46,34 @@ protected: public: virtual ~AbstractContainerMenu(); virtual void addSlotListener(ContainerListener *listener); - vector<shared_ptr<ItemInstance> > *getItems(); + vector<std::shared_ptr<ItemInstance> > *getItems(); void sendData(int id, int value); virtual void broadcastChanges(); virtual bool needsRendered(); - virtual bool clickMenuButton(shared_ptr<Player> player, int buttonId); - Slot *getSlotFor(shared_ptr<Container> c, int index); + virtual bool clickMenuButton(std::shared_ptr<Player> player, int buttonId); + Slot *getSlotFor(std::shared_ptr<Container> c, int index); Slot *getSlot(int index); - virtual shared_ptr<ItemInstance> quickMoveStack(shared_ptr<Player> player, int slotIndex); - virtual shared_ptr<ItemInstance> clicked(int slotIndex, int buttonNum, int clickType, shared_ptr<Player> player); - virtual bool mayCombine(Slot *slot, shared_ptr<ItemInstance> item); + virtual std::shared_ptr<ItemInstance> quickMoveStack(std::shared_ptr<Player> player, int slotIndex); + virtual std::shared_ptr<ItemInstance> clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr<Player> player); + virtual bool mayCombine(Slot *slot, std::shared_ptr<ItemInstance> item); protected: - virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, shared_ptr<Player> player); + virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, std::shared_ptr<Player> player); public: - virtual void removed(shared_ptr<Player> player); - virtual void slotsChanged();// 4J used to take a shared_ptr<Container> container but wasn't using it, so removed to simplify things + virtual void removed(std::shared_ptr<Player> player); + virtual void slotsChanged();// 4J used to take a std::shared_ptr<Container> container but wasn't using it, so removed to simplify things bool isPauseScreen(); - void setItem(unsigned int slot, shared_ptr<ItemInstance> item); + void setItem(unsigned int slot, std::shared_ptr<ItemInstance> item); void setAll(ItemInstanceArray *items); virtual void setData(int id, int value); - short backup(shared_ptr<Inventory> inventory); + short backup(std::shared_ptr<Inventory> inventory); private: - unordered_set<shared_ptr<Player> , PlayerKeyHash, PlayerKeyEq> unSynchedPlayers; + unordered_set<std::shared_ptr<Player> , PlayerKeyHash, PlayerKeyEq> unSynchedPlayers; public: - bool isSynched(shared_ptr<Player> player); - void setSynched(shared_ptr<Player> player, bool synched); - virtual bool stillValid(shared_ptr<Player> player) = 0; + bool isSynched(std::shared_ptr<Player> player); + void setSynched(std::shared_ptr<Player> player, bool synched); + virtual bool stillValid(std::shared_ptr<Player> player) = 0; // 4J Stu Added for UI unsigned int getSize() { return (unsigned int)slots->size(); } @@ -81,7 +81,7 @@ public: protected: // 4J Stu - Changes to return bool brought forward from 1.2 - bool moveItemStackTo(shared_ptr<ItemInstance> itemStack, int startSlot, int endSlot, bool backwards); + bool moveItemStackTo(std::shared_ptr<ItemInstance> itemStack, int startSlot, int endSlot, bool backwards); public: virtual bool isOverrideResultClick(int slotNum, int buttonNum); |
