feat: implement basic tower placement

This commit is contained in:
2021-09-19 13:43:45 +02:00
parent bcde4278ab
commit 52a143769e
17 changed files with 318 additions and 52 deletions

View File

@@ -9,6 +9,7 @@ namespace client{
WorldClient::WorldClient(ClientGame* game) : game::World(game), protocol::PacketHandler(game->GetDispatcher()), m_Game(game){
GetDispatcher()->RegisterHandler(protocol::PacketType::WorldBeginData, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::WorldData, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::WorldAddTower, this);
GetDispatcher()->RegisterHandler(protocol::PacketType::SpawnMob, this);
}
@@ -20,6 +21,10 @@ void WorldClient::HandlePacket(protocol::WorldDataPacket* packet){
loadMap(packet);
}
void WorldClient::HandlePacket(protocol::WorldAddTowerPacket* packet){
}
void WorldClient::HandlePacket(protocol::SpawnMobPacket* packet){
spawnMobAt(packet->getMobID(), packet->getMobType(), packet->getMobLevel(), packet->getSender(),
packet->getMobX(), packet->getMobY(), packet->getMobDirection());