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/RepairMenu.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Minecraft.World/RepairMenu.cpp') diff --git a/Minecraft.World/RepairMenu.cpp b/Minecraft.World/RepairMenu.cpp index d246b73f..c254eb21 100644 --- a/Minecraft.World/RepairMenu.cpp +++ b/Minecraft.World/RepairMenu.cpp @@ -6,10 +6,10 @@ #include "net.minecraft.world.item.enchantment.h" #include "RepairMenu.h" -RepairMenu::RepairMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt, shared_ptr player) +RepairMenu::RepairMenu(std::shared_ptr inventory, Level *level, int xt, int yt, int zt, std::shared_ptr player) { - resultSlots = shared_ptr( new ResultContainer() ); - repairSlots = shared_ptr( new RepairContainer(this,IDS_REPAIR_AND_NAME, 2) ); + resultSlots = std::shared_ptr( new ResultContainer() ); + repairSlots = std::shared_ptr( new RepairContainer(this,IDS_REPAIR_AND_NAME, 2) ); cost = 0; repairItemCountCost = 0; @@ -38,7 +38,7 @@ RepairMenu::RepairMenu(shared_ptr inventory, Level *level, int xt, in } } -void RepairMenu::slotsChanged(shared_ptr container) +void RepairMenu::slotsChanged(std::shared_ptr container) { AbstractContainerMenu::slotsChanged(); @@ -47,7 +47,7 @@ void RepairMenu::slotsChanged(shared_ptr container) void RepairMenu::createResult() { - shared_ptr input = repairSlots->getItem(INPUT_SLOT); + std::shared_ptr input = repairSlots->getItem(INPUT_SLOT); cost = 0; int price = 0; int tax = 0; @@ -63,8 +63,8 @@ void RepairMenu::createResult() } else { - shared_ptr result = input->copy(); - shared_ptr addition = repairSlots->getItem(ADDITIONAL_SLOT); + std::shared_ptr result = input->copy(); + std::shared_ptr addition = repairSlots->getItem(ADDITIONAL_SLOT); unordered_map *enchantments = EnchantmentHelper::getEnchantments(result); bool usingBook = false; @@ -319,14 +319,14 @@ void RepairMenu::setData(int id, int value) if (id == DATA_TOTAL_COST) cost = value; } -void RepairMenu::removed(shared_ptr player) +void RepairMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); if (level->isClientSide) return; for (int i = 0; i < repairSlots->getContainerSize(); i++) { - shared_ptr item = repairSlots->removeItemNoUpdate(i); + std::shared_ptr item = repairSlots->removeItemNoUpdate(i); if (item != NULL) { player->drop(item); @@ -334,20 +334,20 @@ void RepairMenu::removed(shared_ptr player) } } -bool RepairMenu::stillValid(shared_ptr player) +bool RepairMenu::stillValid(std::shared_ptr player) { if (level->getTile(x, y, z) != Tile::anvil_Id) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; return true; } -shared_ptr RepairMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr RepairMenu::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 == RESULT_SLOT) -- cgit v1.2.3