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.
This commit is contained in:
@@ -17,7 +17,7 @@ TeleportEntityPacket::TeleportEntityPacket()
|
||||
xRot = 0;
|
||||
}
|
||||
|
||||
TeleportEntityPacket::TeleportEntityPacket(shared_ptr<Entity> e)
|
||||
TeleportEntityPacket::TeleportEntityPacket(std::shared_ptr<Entity> e)
|
||||
{
|
||||
id = e->entityId;
|
||||
x = Mth::floor(e->x * 32);
|
||||
@@ -53,7 +53,7 @@ void TeleportEntityPacket::read(DataInputStream *dis) //throws IOException
|
||||
xRot = (byte) dis->read();
|
||||
}
|
||||
|
||||
void TeleportEntityPacket::write(DataOutputStream *dos) //throws IOException
|
||||
void TeleportEntityPacket::write(DataOutputStream *dos) //throws IOException
|
||||
{
|
||||
dos->writeShort(id);
|
||||
#ifdef _LARGE_WORLDS
|
||||
@@ -69,12 +69,12 @@ void TeleportEntityPacket::write(DataOutputStream *dos) //throws IOException
|
||||
dos->write(xRot);
|
||||
}
|
||||
|
||||
void TeleportEntityPacket::handle(PacketListener *listener)
|
||||
void TeleportEntityPacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleTeleportEntity(shared_from_this());
|
||||
}
|
||||
|
||||
int TeleportEntityPacket::getEstimatedSize()
|
||||
int TeleportEntityPacket::getEstimatedSize()
|
||||
{
|
||||
return 2 + 2 + 2 + 2 + 1 + 1;
|
||||
}
|
||||
@@ -84,8 +84,8 @@ bool TeleportEntityPacket::canBeInvalidated()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TeleportEntityPacket::isInvalidatedBy(shared_ptr<Packet> packet)
|
||||
bool TeleportEntityPacket::isInvalidatedBy(std::shared_ptr<Packet> packet)
|
||||
{
|
||||
shared_ptr<TeleportEntityPacket> target = dynamic_pointer_cast<TeleportEntityPacket>(packet);
|
||||
std::shared_ptr<TeleportEntityPacket> target = dynamic_pointer_cast<TeleportEntityPacket>(packet);
|
||||
return target->id == id;
|
||||
}
|
||||
Reference in New Issue
Block a user