aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/TradeItemPacket.cpp
blob: 4148071faa7c28c37303385e3a1d0dc1e42be6b3 (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 "TradeItemPacket.h"



TradeItemPacket::TradeItemPacket()
{
	containerId = 0;
	offer = 0;
}

TradeItemPacket::TradeItemPacket(int containerId, int offer)
{
	this->containerId = containerId;
	this->offer = offer;
}

void TradeItemPacket::handle(PacketListener *listener)
{
	listener->handleTradeItem(shared_from_this());
}

void TradeItemPacket::read(DataInputStream *dis) //throws IOException 
{
	containerId = dis->readInt();
	offer = dis->readInt();
}

void TradeItemPacket::write(DataOutputStream *dos) //throws IOException
{
	dos->writeInt(containerId);
	dos->writeInt(offer);
}

int TradeItemPacket::getEstimatedSize() 
{
	return 8;
}