mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:30:06 +00:00
Packet create functions
This commit is contained in:
parent
95a3bb7cb7
commit
0ef21fd609
12 changed files with 95 additions and 0 deletions
|
|
@ -35,6 +35,8 @@ public:
|
||||||
|
|
||||||
bool Parse(std::istream& is) override;
|
bool Parse(std::istream& is) override;
|
||||||
|
|
||||||
|
static std::shared_ptr<LinkedContourVectorPacket> Create(std::istream& is);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<LinkedContourVectorPacketImpl> p;
|
std::unique_ptr<LinkedContourVectorPacketImpl> p;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ public:
|
||||||
|
|
||||||
bool Parse(std::istream& is) override;
|
bool Parse(std::istream& is) override;
|
||||||
|
|
||||||
|
static std::shared_ptr<LinkedVectorPacket> Create(std::istream& is);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<LinkedVectorPacketImpl> p;
|
std::unique_ptr<LinkedVectorPacketImpl> p;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ public:
|
||||||
|
|
||||||
bool Parse(std::istream& is) override;
|
bool Parse(std::istream& is) override;
|
||||||
|
|
||||||
|
static std::shared_ptr<SetColorLevelPacket> Create(std::istream& is);
|
||||||
|
|
||||||
static constexpr size_t SIZE = 6u;
|
static constexpr size_t SIZE = 6u;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ public:
|
||||||
|
|
||||||
bool Parse(std::istream& is) override;
|
bool Parse(std::istream& is) override;
|
||||||
|
|
||||||
|
static std::shared_ptr<TextAndSpecialSymbolPacket> Create(std::istream& is);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<TextAndSpecialSymbolPacketImpl> p;
|
std::unique_ptr<TextAndSpecialSymbolPacketImpl> p;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ public:
|
||||||
|
|
||||||
bool Parse(std::istream& is) override;
|
bool Parse(std::istream& is) override;
|
||||||
|
|
||||||
|
static std::shared_ptr<UnlinkedContourVectorPacket> Create(std::istream& is);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<UnlinkedContourVectorPacketImpl> p;
|
std::unique_ptr<UnlinkedContourVectorPacketImpl> p;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ public:
|
||||||
|
|
||||||
bool Parse(std::istream& is) override;
|
bool Parse(std::istream& is) override;
|
||||||
|
|
||||||
|
static std::shared_ptr<UnlinkedVectorPacket> Create(std::istream& is);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<UnlinkedVectorPacketImpl> p;
|
std::unique_ptr<UnlinkedVectorPacketImpl> p;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,20 @@ bool LinkedContourVectorPacket::Parse(std::istream& is)
|
||||||
return blockValid;
|
return blockValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<LinkedContourVectorPacket>
|
||||||
|
LinkedContourVectorPacket::Create(std::istream& is)
|
||||||
|
{
|
||||||
|
std::shared_ptr<LinkedContourVectorPacket> packet =
|
||||||
|
std::make_shared<LinkedContourVectorPacket>();
|
||||||
|
|
||||||
|
if (!packet->Parse(is))
|
||||||
|
{
|
||||||
|
packet.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace rpg
|
} // namespace rpg
|
||||||
} // namespace wsr88d
|
} // namespace wsr88d
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,19 @@ bool LinkedVectorPacket::Parse(std::istream& is)
|
||||||
return blockValid;
|
return blockValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<LinkedVectorPacket> LinkedVectorPacket::Create(std::istream& is)
|
||||||
|
{
|
||||||
|
std::shared_ptr<LinkedVectorPacket> packet =
|
||||||
|
std::make_shared<LinkedVectorPacket>();
|
||||||
|
|
||||||
|
if (!packet->Parse(is))
|
||||||
|
{
|
||||||
|
packet.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace rpg
|
} // namespace rpg
|
||||||
} // namespace wsr88d
|
} // namespace wsr88d
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,20 @@ bool SetColorLevelPacket::Parse(std::istream& is)
|
||||||
return blockValid;
|
return blockValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<SetColorLevelPacket>
|
||||||
|
SetColorLevelPacket::Create(std::istream& is)
|
||||||
|
{
|
||||||
|
std::shared_ptr<SetColorLevelPacket> packet =
|
||||||
|
std::make_shared<SetColorLevelPacket>();
|
||||||
|
|
||||||
|
if (!packet->Parse(is))
|
||||||
|
{
|
||||||
|
packet.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace rpg
|
} // namespace rpg
|
||||||
} // namespace wsr88d
|
} // namespace wsr88d
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,20 @@ bool TextAndSpecialSymbolPacket::Parse(std::istream& is)
|
||||||
return blockValid;
|
return blockValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<TextAndSpecialSymbolPacket>
|
||||||
|
TextAndSpecialSymbolPacket::Create(std::istream& is)
|
||||||
|
{
|
||||||
|
std::shared_ptr<TextAndSpecialSymbolPacket> packet =
|
||||||
|
std::make_shared<TextAndSpecialSymbolPacket>();
|
||||||
|
|
||||||
|
if (!packet->Parse(is))
|
||||||
|
{
|
||||||
|
packet.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace rpg
|
} // namespace rpg
|
||||||
} // namespace wsr88d
|
} // namespace wsr88d
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,20 @@ bool UnlinkedContourVectorPacket::Parse(std::istream& is)
|
||||||
return blockValid;
|
return blockValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<UnlinkedContourVectorPacket>
|
||||||
|
UnlinkedContourVectorPacket::Create(std::istream& is)
|
||||||
|
{
|
||||||
|
std::shared_ptr<UnlinkedContourVectorPacket> packet =
|
||||||
|
std::make_shared<UnlinkedContourVectorPacket>();
|
||||||
|
|
||||||
|
if (!packet->Parse(is))
|
||||||
|
{
|
||||||
|
packet.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace rpg
|
} // namespace rpg
|
||||||
} // namespace wsr88d
|
} // namespace wsr88d
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,20 @@ bool UnlinkedVectorPacket::Parse(std::istream& is)
|
||||||
return blockValid;
|
return blockValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<UnlinkedVectorPacket>
|
||||||
|
UnlinkedVectorPacket::Create(std::istream& is)
|
||||||
|
{
|
||||||
|
std::shared_ptr<UnlinkedVectorPacket> packet =
|
||||||
|
std::make_shared<UnlinkedVectorPacket>();
|
||||||
|
|
||||||
|
if (!packet->Parse(is))
|
||||||
|
{
|
||||||
|
packet.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace rpg
|
} // namespace rpg
|
||||||
} // namespace wsr88d
|
} // namespace wsr88d
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue