Packet create functions

This commit is contained in:
Dan Paulat 2021-12-28 16:51:23 -06:00
parent 95a3bb7cb7
commit 0ef21fd609
12 changed files with 95 additions and 0 deletions

View file

@ -145,6 +145,20 @@ bool UnlinkedVectorPacket::Parse(std::istream& is)
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 wsr88d
} // namespace scwx