mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:30:06 +00:00
Generic data packet
This commit is contained in:
parent
cbb3ec0368
commit
54ac07a254
4 changed files with 163 additions and 0 deletions
44
wxdata/include/scwx/wsr88d/rpg/generic_data_packet.hpp
Normal file
44
wxdata/include/scwx/wsr88d/rpg/generic_data_packet.hpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/wsr88d/rpg/packet.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
{
|
||||
namespace rpg
|
||||
{
|
||||
|
||||
class GenericDataPacketImpl;
|
||||
|
||||
class GenericDataPacket : public Packet
|
||||
{
|
||||
public:
|
||||
explicit GenericDataPacket();
|
||||
~GenericDataPacket();
|
||||
|
||||
GenericDataPacket(const GenericDataPacket&) = delete;
|
||||
GenericDataPacket& operator=(const GenericDataPacket&) = delete;
|
||||
|
||||
GenericDataPacket(GenericDataPacket&&) noexcept;
|
||||
GenericDataPacket& operator=(GenericDataPacket&&) noexcept;
|
||||
|
||||
uint16_t packet_code() const;
|
||||
uint32_t length_of_block() const;
|
||||
|
||||
size_t data_size() const override;
|
||||
|
||||
bool Parse(std::istream& is) override;
|
||||
|
||||
static std::shared_ptr<GenericDataPacket> Create(std::istream& is);
|
||||
|
||||
private:
|
||||
std::unique_ptr<GenericDataPacketImpl> p;
|
||||
};
|
||||
|
||||
} // namespace rpg
|
||||
} // namespace wsr88d
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue