mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-19 12:04:15 +01:00
Co-authored-by: DrPerkyLegit <116128211+DrPerkyLegit@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Anaël <60509176+Bakoubak@users.noreply.github.com> Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/4205
48 lines
894 B
C++
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;
|
|
}
|