first commit
This commit is contained in:
37
Minecraft.World/UpdateProgressPacket.cpp
Normal file
37
Minecraft.World/UpdateProgressPacket.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "stdafx.h"
|
||||
#include <iostream>
|
||||
#include "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;
|
||||
}
|
||||
Reference in New Issue
Block a user