diff options
Diffstat (limited to 'Minecraft.World/ContainerClosePacket.cpp')
| -rw-r--r-- | Minecraft.World/ContainerClosePacket.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Minecraft.World/ContainerClosePacket.cpp b/Minecraft.World/ContainerClosePacket.cpp new file mode 100644 index 00000000..964359f9 --- /dev/null +++ b/Minecraft.World/ContainerClosePacket.cpp @@ -0,0 +1,37 @@ +#include "stdafx.h" +#include <iostream> +#include "InputOutputStream.h" +#include "PacketListener.h" +#include "ContainerClosePacket.h" + + + +ContainerClosePacket::ContainerClosePacket() +{ + containerId = 0; +} + +ContainerClosePacket::ContainerClosePacket(int containerId) +{ + this->containerId = containerId; +} + +void ContainerClosePacket::handle(PacketListener *listener) +{ + listener->handleContainerClose(shared_from_this()); +} + +void ContainerClosePacket::read(DataInputStream *dis) //throws IOException +{ + containerId = dis->readByte(); +} + +void ContainerClosePacket::write(DataOutputStream *dos) //throws IOException +{ + dos->writeByte(containerId); +} + +int ContainerClosePacket::getEstimatedSize() +{ + return 1; +} |
