mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-25 13:53:37 +00:00
38 lines
748 B
C++
38 lines
748 B
C++
#include "../../Platform/stdafx.h"
|
|
#include <iostream>
|
|
#include "../../IO/Streams/InputOutputStream.h"
|
|
#include "PacketListener.h"
|
|
#include "UpdateProgressPacket.h"
|
|
|
|
|
|
|
|
UpdateProgressPacket::UpdateProgressPacket()
|
|
{
|
|
this->m_percentage = 0;
|
|
}
|
|
|
|
UpdateProgressPacket::UpdateProgressPacket(int percentage)
|
|
{
|
|
this->m_percentage = percentage;
|
|
}
|
|
|
|
void UpdateProgressPacket::read(DataInputStream *dis) //throws IOException
|
|
{
|
|
m_percentage = dis->readByte();
|
|
}
|
|
|
|
void UpdateProgressPacket::write(DataOutputStream *dos) //throws IOException
|
|
{
|
|
dos->writeByte(m_percentage);
|
|
}
|
|
|
|
void UpdateProgressPacket::handle(PacketListener *listener)
|
|
{
|
|
listener->handleUpdateProgress(shared_from_this());
|
|
}
|
|
|
|
int UpdateProgressPacket::getEstimatedSize()
|
|
{
|
|
return 1;
|
|
}
|