Files
neoLegacy/Minecraft.World/MoveVehiclePacket.cpp
T

48 lines
894 B
C++

#include "stdafx.h"
#include "InputOutputStream.h"
#include "PacketListener.h"
#include "MoveVehiclePacket.h"
MoveVehiclePacket::MoveVehiclePacket()
{
x = y = z = 0.0;
yRot = xRot = 0.0f;
}
MoveVehiclePacket::MoveVehiclePacket(double x, double y, double z, float yRot, float xRot)
{
this->x = x;
this->y = y;
this->z = z;
this->yRot = yRot;
this->xRot = xRot;
}
void MoveVehiclePacket::read(DataInputStream *dis)
{
x = dis->readDouble();
y = dis->readDouble();
z = dis->readDouble();
yRot = dis->readFloat();
xRot = dis->readFloat();
}
void MoveVehiclePacket::write(DataOutputStream *dos)
{
dos->writeDouble(x);
dos->writeDouble(y);
dos->writeDouble(z);
dos->writeFloat(yRot);
dos->writeFloat(xRot);
}
void MoveVehiclePacket::handle(PacketListener *listener)
{
listener->handleMoveVehicle(shared_from_this());
}
int MoveVehiclePacket::getEstimatedSize()
{
return 32;
}