mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 12:23:36 +00:00
34 lines
806 B
C++
34 lines
806 B
C++
#include "../../Platform/stdafx.h"
|
|
#include <iostream>
|
|
#include "../../IO/Streams/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; }
|