1er commit

This commit is contained in:
2021-08-21 10:14:47 +02:00
commit a99ecf7c2d
99 changed files with 66605 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
#include "game/client/WorldClient.h"
#include "protocol/PacketDispatcher.h"
#include "game/client/ClientGame.h"
#include "render/WorldRenderer.h"
namespace td{
namespace client{
WorldClient::WorldClient(ClientGame* game) : m_Game(game), game::World(game), protocol::PacketHandler(game->GetDispatcher()){
GetDispatcher()->RegisterHandler(protocol::PacketType::WorldBeginData, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::WorldData, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::SpawnMob, this);
}
void WorldClient::HandlePacket(protocol::WorldBeginDataPacket* packet){
loadMap(packet);
}
void WorldClient::HandlePacket(protocol::WorldDataPacket* packet){
loadMap(packet);
render::WorldRenderer::init(this);
}
void WorldClient::HandlePacket(protocol::SpawnMobPacket* packet){
spawnMobAt(packet->getMobID(), packet->getMobType(), packet->getMobLevel(), packet->getSender(),
packet->getMobX(), packet->getMobY(), packet->getMobDirection());
}
} // namespace client
} // namespace td