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/ContainerMenu.cpp | |
| 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/ContainerMenu.cpp')
| -rw-r--r-- | Minecraft.World/ContainerMenu.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/ContainerMenu.cpp b/Minecraft.World/ContainerMenu.cpp index 57190024..534da741 100644 --- a/Minecraft.World/ContainerMenu.cpp +++ b/Minecraft.World/ContainerMenu.cpp @@ -8,7 +8,7 @@ #include "..\Minecraft.Client\LocalPlayer.h" #include "ContainerMenu.h" -ContainerMenu::ContainerMenu(shared_ptr<Container> inventory, shared_ptr<Container> container) : AbstractContainerMenu() +ContainerMenu::ContainerMenu(std::shared_ptr<Container> inventory, std::shared_ptr<Container> container) : AbstractContainerMenu() { this->container = container; this->containerRows = container->getContainerSize() / 9; @@ -37,18 +37,18 @@ ContainerMenu::ContainerMenu(shared_ptr<Container> inventory, shared_ptr<Contain } } -bool ContainerMenu::stillValid(shared_ptr<Player> player) +bool ContainerMenu::stillValid(std::shared_ptr<Player> player) { return container->stillValid(player); } -shared_ptr<ItemInstance> ContainerMenu::quickMoveStack(shared_ptr<Player> player, int slotIndex) +std::shared_ptr<ItemInstance> ContainerMenu::quickMoveStack(std::shared_ptr<Player> player, int slotIndex) { - shared_ptr<ItemInstance> clicked = nullptr; + std::shared_ptr<ItemInstance> clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr<ItemInstance> stack = slot->getItem(); + std::shared_ptr<ItemInstance> stack = slot->getItem(); clicked = stack->copy(); if (slotIndex < containerRows * 9) @@ -79,25 +79,25 @@ shared_ptr<ItemInstance> ContainerMenu::quickMoveStack(shared_ptr<Player> player return clicked; } -void ContainerMenu::removed(shared_ptr<Player> player) +void ContainerMenu::removed(std::shared_ptr<Player> player) { AbstractContainerMenu::removed(player); container->stopOpen(); } -shared_ptr<ItemInstance> ContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, shared_ptr<Player> player) +std::shared_ptr<ItemInstance> ContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr<Player> player) { - shared_ptr<ItemInstance> out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); + std::shared_ptr<ItemInstance> out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); #ifdef _EXTENDED_ACHIEVEMENTS - shared_ptr<LocalPlayer> localPlayer = dynamic_pointer_cast<LocalPlayer>(player); + std::shared_ptr<LocalPlayer> localPlayer = dynamic_pointer_cast<LocalPlayer>(player); if (localPlayer != NULL) // 4J-JEV: For "Chestful o'Cobblestone" achievement. { int cobblecount = 0; for (int i = 0; i < container->getContainerSize(); i++) { - shared_ptr<ItemInstance> item = container->getItem(i); + std::shared_ptr<ItemInstance> item = container->getItem(i); if ( (item != nullptr) && (item->id == Tile::stoneBrick_Id) ) { cobblecount += item->GetCount(); |
