feat: add basic towers rendering
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
#include "game/client/ClientGame.h"
|
||||
#include "render/WorldRenderer.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace td {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -21,10 +22,6 @@ void WorldClient::HandlePacket(protocol::WorldDataPacket* packet) {
|
||||
loadMap(packet);
|
||||
}
|
||||
|
||||
void WorldClient::HandlePacket(protocol::WorldAddTowerPacket* packet) {
|
||||
placeTowerAt(packet->getTowerType(), packet->getTowerX(), packet->getTowerY(), packet->getBuilder());
|
||||
}
|
||||
|
||||
void WorldClient::HandlePacket(protocol::SpawnMobPacket* packet) {
|
||||
spawnMobAt(packet->getMobID(), packet->getMobType(), packet->getMobLevel(), packet->getSender(),
|
||||
packet->getMobX(), packet->getMobY(), packet->getMobDirection());
|
||||
|
||||
Reference in New Issue
Block a user