refactor: format code

This commit is contained in:
2021-09-19 17:33:16 +02:00
parent 52a143769e
commit 0856ca47ca
71 changed files with 1102 additions and 1110 deletions

View File

@@ -4,9 +4,9 @@
namespace td {
namespace protocol {
namespace PacketFactory{
namespace PacketFactory {
using PacketCreator = std::function<Packet*()>;
using PacketCreator = std::function<Packet* ()>;
static std::map<PacketType, PacketCreator> packets = {
{PacketType::PlayerLogin, []() -> Packet* {return new PlayerLoginPacket();} },
@@ -30,7 +30,7 @@ static std::map<PacketType, PacketCreator> packets = {
{PacketType::WorldAddTower, []() -> Packet* {return new WorldAddTowerPacket(); } },
};
Packet* createPacket(PacketType type, DataBuffer& buffer){
Packet* createPacket(PacketType type, DataBuffer& buffer) {
Packet* packet = packets[type]();
packet->Deserialize(buffer);
return packet;