mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 13:43:36 +00:00
28 lines
757 B
C++
28 lines
757 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; }
|