mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:00:04 +00:00
Linked vector packet
This commit is contained in:
parent
cb86ab4b9b
commit
ab702e9927
6 changed files with 351 additions and 0 deletions
43
wxdata/include/scwx/wsr88d/rpg/linked_vector_packet.hpp
Normal file
43
wxdata/include/scwx/wsr88d/rpg/linked_vector_packet.hpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/wsr88d/rpg/packet.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
{
|
||||
namespace rpg
|
||||
{
|
||||
|
||||
class LinkedVectorPacketImpl;
|
||||
|
||||
class LinkedVectorPacket : public Packet
|
||||
{
|
||||
public:
|
||||
explicit LinkedVectorPacket();
|
||||
~LinkedVectorPacket();
|
||||
|
||||
LinkedVectorPacket(const LinkedVectorPacket&) = delete;
|
||||
LinkedVectorPacket& operator=(const LinkedVectorPacket&) = delete;
|
||||
|
||||
LinkedVectorPacket(LinkedVectorPacket&&) noexcept;
|
||||
LinkedVectorPacket& operator=(LinkedVectorPacket&&) noexcept;
|
||||
|
||||
uint16_t packet_code() const;
|
||||
uint16_t length_of_block() const;
|
||||
uint16_t value_of_vector() const;
|
||||
|
||||
size_t data_size() const override;
|
||||
|
||||
bool Parse(std::istream& is) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<LinkedVectorPacketImpl> p;
|
||||
};
|
||||
|
||||
} // namespace rpg
|
||||
} // namespace wsr88d
|
||||
} // namespace scwx
|
||||
34
wxdata/include/scwx/wsr88d/rpg/packet.hpp
Normal file
34
wxdata/include/scwx/wsr88d/rpg/packet.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/wsr88d/message.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
{
|
||||
namespace rpg
|
||||
{
|
||||
|
||||
class Packet : public Message
|
||||
{
|
||||
protected:
|
||||
explicit Packet();
|
||||
|
||||
Packet(const Packet&) = delete;
|
||||
Packet& operator=(const Packet&) = delete;
|
||||
|
||||
Packet(Packet&&) noexcept;
|
||||
Packet& operator=(Packet&&) noexcept;
|
||||
|
||||
public:
|
||||
virtual ~Packet();
|
||||
|
||||
virtual uint16_t packet_code() const = 0;
|
||||
};
|
||||
|
||||
} // namespace rpg
|
||||
} // namespace wsr88d
|
||||
} // namespace scwx
|
||||
46
wxdata/include/scwx/wsr88d/rpg/vector2d.hpp
Normal file
46
wxdata/include/scwx/wsr88d/rpg/vector2d.hpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/wsr88d/message.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
{
|
||||
namespace rpg
|
||||
{
|
||||
|
||||
class Vector2DImpl;
|
||||
|
||||
class Vector2D : public Message
|
||||
{
|
||||
public:
|
||||
explicit Vector2D();
|
||||
~Vector2D();
|
||||
|
||||
Vector2D(const Vector2D&) = delete;
|
||||
Vector2D& operator=(const Vector2D&) = delete;
|
||||
|
||||
Vector2D(Vector2D&&) noexcept;
|
||||
Vector2D& operator=(Vector2D&&) noexcept;
|
||||
|
||||
int16_t start_i() const;
|
||||
int16_t start_j() const;
|
||||
int16_t end_i() const;
|
||||
int16_t end_j() const;
|
||||
|
||||
size_t data_size() const override;
|
||||
|
||||
bool Parse(std::istream& is) override;
|
||||
|
||||
static constexpr size_t SIZE = 8u;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Vector2DImpl> p;
|
||||
};
|
||||
|
||||
} // namespace rpg
|
||||
} // namespace wsr88d
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue