aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MerchantResultSlot.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
commit7074f35e4ba831e358117842b99ee35b87f85ae5 (patch)
tree7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/MerchantResultSlot.cpp
parentd63f79325f85e014361eb8cf1e41eaebedb1ae71 (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/MerchantResultSlot.cpp')
-rw-r--r--Minecraft.World/MerchantResultSlot.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/Minecraft.World/MerchantResultSlot.cpp b/Minecraft.World/MerchantResultSlot.cpp
index fedbcc4a..7617bdf1 100644
--- a/Minecraft.World/MerchantResultSlot.cpp
+++ b/Minecraft.World/MerchantResultSlot.cpp
@@ -3,7 +3,7 @@
#include "net.minecraft.world.item.trading.h"
#include "MerchantResultSlot.h"
-MerchantResultSlot::MerchantResultSlot(Player *player, shared_ptr<Merchant> merchant, shared_ptr<MerchantContainer> slots, int id, int x, int y) : Slot(slots, id, x, y)
+MerchantResultSlot::MerchantResultSlot(Player *player, std::shared_ptr<Merchant> merchant, std::shared_ptr<MerchantContainer> slots, int id, int x, int y) : Slot(slots, id, x, y)
{
this->player = player;
this->merchant = merchant;
@@ -11,12 +11,12 @@ MerchantResultSlot::MerchantResultSlot(Player *player, shared_ptr<Merchant> merc
removeCount = 0;
}
-bool MerchantResultSlot::mayPlace(shared_ptr<ItemInstance> item)
+bool MerchantResultSlot::mayPlace(std::shared_ptr<ItemInstance> item)
{
return false;
}
-shared_ptr<ItemInstance> MerchantResultSlot::remove(int c)
+std::shared_ptr<ItemInstance> MerchantResultSlot::remove(int c)
{
if (hasItem())
{
@@ -25,27 +25,27 @@ shared_ptr<ItemInstance> MerchantResultSlot::remove(int c)
return Slot::remove(c);
}
-void MerchantResultSlot::onQuickCraft(shared_ptr<ItemInstance> picked, int count)
+void MerchantResultSlot::onQuickCraft(std::shared_ptr<ItemInstance> picked, int count)
{
removeCount += count;
checkTakeAchievements(picked);
}
-void MerchantResultSlot::checkTakeAchievements(shared_ptr<ItemInstance> carried)
+void MerchantResultSlot::checkTakeAchievements(std::shared_ptr<ItemInstance> carried)
{
carried->onCraftedBy(player->level, dynamic_pointer_cast<Player>(player->shared_from_this()), removeCount);
removeCount = 0;
}
-void MerchantResultSlot::onTake(shared_ptr<Player> player, shared_ptr<ItemInstance> carried)
+void MerchantResultSlot::onTake(std::shared_ptr<Player> player, std::shared_ptr<ItemInstance> carried)
{
checkTakeAchievements(carried);
MerchantRecipe *activeRecipe = slots->getActiveRecipe();
if (activeRecipe != NULL)
{
- shared_ptr<ItemInstance> item1 = slots->getItem(MerchantMenu::PAYMENT1_SLOT);
- shared_ptr<ItemInstance> item2 = slots->getItem(MerchantMenu::PAYMENT2_SLOT);
+ std::shared_ptr<ItemInstance> item1 = slots->getItem(MerchantMenu::PAYMENT1_SLOT);
+ std::shared_ptr<ItemInstance> item2 = slots->getItem(MerchantMenu::PAYMENT2_SLOT);
// remove payment items, but remember slots may have switched
if (removePaymentItemsIfMatching(activeRecipe, item1, item2) || removePaymentItemsIfMatching(activeRecipe, item2, item1))
@@ -66,15 +66,15 @@ void MerchantResultSlot::onTake(shared_ptr<Player> player, shared_ptr<ItemInstan
}
}
-bool MerchantResultSlot::mayCombine(shared_ptr<ItemInstance> second)
+bool MerchantResultSlot::mayCombine(std::shared_ptr<ItemInstance> second)
{
return false;
}
-bool MerchantResultSlot::removePaymentItemsIfMatching(MerchantRecipe *activeRecipe, shared_ptr<ItemInstance> a, shared_ptr<ItemInstance> b)
+bool MerchantResultSlot::removePaymentItemsIfMatching(MerchantRecipe *activeRecipe, std::shared_ptr<ItemInstance> a, std::shared_ptr<ItemInstance> b)
{
- shared_ptr<ItemInstance> buyA = activeRecipe->getBuyAItem();
- shared_ptr<ItemInstance> buyB = activeRecipe->getBuyBItem();
+ std::shared_ptr<ItemInstance> buyA = activeRecipe->getBuyAItem();
+ std::shared_ptr<ItemInstance> buyB = activeRecipe->getBuyBItem();
if (a != NULL && a->id == buyA->id)
{