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/ContainerSetContentPacket.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/ContainerSetContentPacket.cpp')
| -rw-r--r-- | Minecraft.World/ContainerSetContentPacket.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.World/ContainerSetContentPacket.cpp b/Minecraft.World/ContainerSetContentPacket.cpp index 13cfebd7..62382888 100644 --- a/Minecraft.World/ContainerSetContentPacket.cpp +++ b/Minecraft.World/ContainerSetContentPacket.cpp @@ -12,28 +12,28 @@ ContainerSetContentPacket::~ContainerSetContentPacket() delete[] items.data; } -ContainerSetContentPacket::ContainerSetContentPacket() +ContainerSetContentPacket::ContainerSetContentPacket() { containerId = 0; } -ContainerSetContentPacket::ContainerSetContentPacket(int containerId, vector<shared_ptr<ItemInstance> > *newItems) +ContainerSetContentPacket::ContainerSetContentPacket(int containerId, vector<std::shared_ptr<ItemInstance> > *newItems) { this->containerId = containerId; items = ItemInstanceArray((int)newItems->size()); for (unsigned int i = 0; i < items.length; i++) { - shared_ptr<ItemInstance> item = newItems->at(i); + std::shared_ptr<ItemInstance> item = newItems->at(i); items[i] = item == NULL ? nullptr : item->copy(); } } -void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException +void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException { containerId = dis->readByte(); int count = dis->readShort(); items = ItemInstanceArray(count); - for (int i = 0; i < count; i++) + for (int i = 0; i < count; i++) { items[i] = readItem(dis); } @@ -43,7 +43,7 @@ void ContainerSetContentPacket::write(DataOutputStream *dos) //throws IOExceptio { dos->writeByte(containerId); dos->writeShort(items.length); - for (unsigned int i = 0; i < items.length; i++) + for (unsigned int i = 0; i < items.length; i++) { writeItem(items[i], dos); } @@ -54,7 +54,7 @@ void ContainerSetContentPacket::handle(PacketListener *listener) listener->handleContainerContent(shared_from_this()); } -int ContainerSetContentPacket::getEstimatedSize() +int ContainerSetContentPacket::getEstimatedSize() { return 3 + items.length * 5; } |
