blob: 1c6da009110dcf79b96b6f7357a24bac07446638 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#include "stdafx.h"
#include <iostream>
#include "InputOutputStream.h"
#include "PacketListener.h"
#include "TakeItemEntityPacket.h"
TakeItemEntityPacket::TakeItemEntityPacket()
{
itemId = -1;
playerId = -1;
}
TakeItemEntityPacket::TakeItemEntityPacket(int itemId, int playerId)
{
this->itemId = itemId;
this->playerId = playerId;
}
void TakeItemEntityPacket::read(DataInputStream *dis) //throws IOException
{
itemId = dis->readInt();
playerId = dis->readInt();
}
void TakeItemEntityPacket::write(DataOutputStream *dos) //throws IOException
{
dos->writeInt(itemId);
dos->writeInt(playerId);
}
void TakeItemEntityPacket::handle(PacketListener *listener)
{
listener->handleTakeItemEntity(shared_from_this());
}
int TakeItemEntityPacket::getEstimatedSize()
{
return 8;
}
|