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/MerchantRecipeList.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/MerchantRecipeList.cpp')
| -rw-r--r-- | Minecraft.World/MerchantRecipeList.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.World/MerchantRecipeList.cpp b/Minecraft.World/MerchantRecipeList.cpp index bd7a126c..26436b59 100644 --- a/Minecraft.World/MerchantRecipeList.cpp +++ b/Minecraft.World/MerchantRecipeList.cpp @@ -19,7 +19,7 @@ MerchantRecipeList::~MerchantRecipeList() } } -MerchantRecipe *MerchantRecipeList::getRecipeFor(shared_ptr<ItemInstance> buyA, shared_ptr<ItemInstance> buyB, int selectionHint) +MerchantRecipe *MerchantRecipeList::getRecipeFor(std::shared_ptr<ItemInstance> buyA, std::shared_ptr<ItemInstance> buyB, int selectionHint) { if (selectionHint > 0 && selectionHint < m_recipes.size()) { @@ -67,7 +67,7 @@ bool MerchantRecipeList::addIfNewOrBetter(MerchantRecipe *recipe) return true; } -MerchantRecipe *MerchantRecipeList::getMatchingRecipeFor(shared_ptr<ItemInstance> buy, shared_ptr<ItemInstance> buyB, shared_ptr<ItemInstance> sell) +MerchantRecipe *MerchantRecipeList::getMatchingRecipeFor(std::shared_ptr<ItemInstance> buy, std::shared_ptr<ItemInstance> buyB, std::shared_ptr<ItemInstance> sell) { for (int i = 0; i < m_recipes.size(); i++) { @@ -92,7 +92,7 @@ void MerchantRecipeList::writeToStream(DataOutputStream *stream) Packet::writeItem(r->getBuyAItem(), stream); Packet::writeItem(r->getSellItem(), stream); - shared_ptr<ItemInstance> buyBItem = r->getBuyBItem(); + std::shared_ptr<ItemInstance> buyBItem = r->getBuyBItem(); stream->writeBoolean(buyBItem != NULL); if (buyBItem != NULL) { @@ -111,10 +111,10 @@ MerchantRecipeList *MerchantRecipeList::createFromStream(DataInputStream *stream int count = (int) (stream->readByte() & 0xff); for (int i = 0; i < count; i++) { - shared_ptr<ItemInstance> buy = Packet::readItem(stream); - shared_ptr<ItemInstance> sell = Packet::readItem(stream); + std::shared_ptr<ItemInstance> buy = Packet::readItem(stream); + std::shared_ptr<ItemInstance> sell = Packet::readItem(stream); - shared_ptr<ItemInstance> buyB = nullptr; + std::shared_ptr<ItemInstance> buyB = nullptr; if (stream->readBoolean()) { buyB = Packet::readItem(stream); |
