generated from Persson-dev/Godot-Xmake
add blitz files
This commit is contained in:
21
include/blitz/protocol/PacketFactory.h
Normal file
21
include/blitz/protocol/PacketFactory.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <blitz/protocol/Packets.h>
|
||||
#include <memory>
|
||||
|
||||
namespace blitz {
|
||||
namespace protocol {
|
||||
namespace PacketFactory {
|
||||
|
||||
template<typename PacketDerived, typename = typename std::enable_if<std::is_base_of<Packet, PacketDerived>::value>::type>
|
||||
std::unique_ptr<PacketDerived> CreatePacket() {
|
||||
return std::make_unique<PacketDerived>();
|
||||
}
|
||||
|
||||
const std::unique_ptr<Packet>& CreateReadOnlyPacket(PacketType a_Type);
|
||||
|
||||
void Init();
|
||||
|
||||
} // namespace PacketFactory
|
||||
} // namespace protocol
|
||||
} // namespace blitz
|
||||
Reference in New Issue
Block a user