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/MoveEntityPacket.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Minecraft.World/MoveEntityPacket.cpp') diff --git a/Minecraft.World/MoveEntityPacket.cpp b/Minecraft.World/MoveEntityPacket.cpp index b52482f5..ce33c019 100644 --- a/Minecraft.World/MoveEntityPacket.cpp +++ b/Minecraft.World/MoveEntityPacket.cpp @@ -4,7 +4,7 @@ #include "PacketListener.h" #include "MoveEntityPacket.h" -MoveEntityPacket::MoveEntityPacket() +MoveEntityPacket::MoveEntityPacket() { hasRot = false; @@ -28,7 +28,7 @@ MoveEntityPacket::MoveEntityPacket(int id) xRot = 0; } -void MoveEntityPacket::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::read(DataInputStream *dis) //throws IOException { id = dis->readShort(); } @@ -48,7 +48,7 @@ void MoveEntityPacket::handle(PacketListener *listener) listener->handleMoveEntity(shared_from_this()); } -int MoveEntityPacket::getEstimatedSize() +int MoveEntityPacket::getEstimatedSize() { return 2; } @@ -58,9 +58,9 @@ bool MoveEntityPacket::canBeInvalidated() return true; } -bool MoveEntityPacket::isInvalidatedBy(shared_ptr packet) +bool MoveEntityPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target != NULL && target->id == id; } @@ -79,7 +79,7 @@ MoveEntityPacket::PosRot::PosRot(int id, char xa, char ya, char za, char yRot, c hasRot = true; } -void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); xa = dis->readByte(); @@ -89,7 +89,7 @@ void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException xRot = dis->readByte(); } -void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException +void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); dos->writeByte(xa); @@ -99,12 +99,12 @@ void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException dos->writeByte(xRot); } -int MoveEntityPacket::PosRot::getEstimatedSize() +int MoveEntityPacket::PosRot::getEstimatedSize() { return 2+5; } -MoveEntityPacket::Pos::Pos() +MoveEntityPacket::Pos::Pos() { } @@ -115,7 +115,7 @@ MoveEntityPacket::Pos::Pos(int id, char xa, char ya, char za) : MoveEntityPacket this->za = za; } -void MoveEntityPacket::Pos::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::Pos::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); xa = dis->readByte(); @@ -136,7 +136,7 @@ int MoveEntityPacket::Pos::getEstimatedSize() return 2+3; } -MoveEntityPacket::Rot::Rot() +MoveEntityPacket::Rot::Rot() { hasRot = true; } @@ -148,14 +148,14 @@ MoveEntityPacket::Rot::Rot(int id, char yRot, char xRot) : MoveEntityPacket(id) hasRot = true; } -void MoveEntityPacket::Rot::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::Rot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); yRot = dis->readByte(); xRot = dis->readByte(); } -void MoveEntityPacket::Rot::write(DataOutputStream *dos) //throws IOException +void MoveEntityPacket::Rot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); dos->writeByte(yRot); -- cgit v1.2.3