From 7074f35e4ba831e358117842b99ee35b87f85ae5 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:58:20 +0700 Subject: 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. --- Minecraft.World/ContainerMenu.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Minecraft.World/ContainerMenu.cpp') 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 inventory, shared_ptr container) : AbstractContainerMenu() +ContainerMenu::ContainerMenu(std::shared_ptr inventory, std::shared_ptr container) : AbstractContainerMenu() { this->container = container; this->containerRows = container->getContainerSize() / 9; @@ -37,18 +37,18 @@ ContainerMenu::ContainerMenu(shared_ptr inventory, shared_ptr player) +bool ContainerMenu::stillValid(std::shared_ptr player) { return container->stillValid(player); } -shared_ptr ContainerMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr ContainerMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex < containerRows * 9) @@ -79,25 +79,25 @@ shared_ptr ContainerMenu::quickMoveStack(shared_ptr player return clicked; } -void ContainerMenu::removed(shared_ptr player) +void ContainerMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); container->stopOpen(); } -shared_ptr ContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player) +std::shared_ptr ContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player) { - shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); + std::shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); #ifdef _EXTENDED_ACHIEVEMENTS - shared_ptr localPlayer = dynamic_pointer_cast(player); + std::shared_ptr localPlayer = dynamic_pointer_cast(player); if (localPlayer != NULL) // 4J-JEV: For "Chestful o'Cobblestone" achievement. { int cobblecount = 0; for (int i = 0; i < container->getContainerSize(); i++) { - shared_ptr item = container->getItem(i); + std::shared_ptr item = container->getItem(i); if ( (item != nullptr) && (item->id == Tile::stoneBrick_Id) ) { cobblecount += item->GetCount(); -- cgit v1.2.3