forked from Kolyah35/minecraft-pe-0.6.1
the whole game
This commit is contained in:
46
src/network/packet/AnimatePacket.h
Executable file
46
src/network/packet/AnimatePacket.h
Executable file
@@ -0,0 +1,46 @@
|
||||
#ifndef NET_MINECRAFT_NETWORK_PACKET__AnimatePacket_H__
|
||||
#define NET_MINECRAFT_NETWORK_PACKET__AnimatePacket_H__
|
||||
|
||||
#include "../Packet.h"
|
||||
|
||||
class AnimatePacket: public Packet
|
||||
{
|
||||
public:
|
||||
static const int Swing = 1;
|
||||
static const int WAKE_UP = 3;
|
||||
|
||||
int entityId;
|
||||
char action;
|
||||
|
||||
AnimatePacket() {}
|
||||
|
||||
AnimatePacket(int action, int entityId)
|
||||
: action(action),
|
||||
entityId(entityId)
|
||||
{}
|
||||
AnimatePacket(int action, Entity* e)
|
||||
: action(action),
|
||||
entityId(e->entityId)
|
||||
{}
|
||||
|
||||
void write(RakNet::BitStream* bitStream)
|
||||
{
|
||||
bitStream->Write((RakNet::MessageID)(ID_USER_PACKET_ENUM + PACKET_ANIMATE));
|
||||
|
||||
bitStream->Write(action);
|
||||
bitStream->Write(entityId);
|
||||
}
|
||||
|
||||
void read(RakNet::BitStream* bitStream)
|
||||
{
|
||||
bitStream->Read(action);
|
||||
bitStream->Read(entityId);
|
||||
}
|
||||
|
||||
void handle(const RakNet::RakNetGUID& source, NetEventCallback* callback)
|
||||
{
|
||||
callback->handle(source, (AnimatePacket*)this);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_NETWORK_PACKET__AnimatePacket_H__*/
|
||||
Reference in New Issue
Block a user