refactor: use of unique_ptr instead of new
This commit is contained in:
@@ -12,20 +12,20 @@ WorldClient::WorldClient(ClientGame* game) : game::World(game), protocol::Packet
|
||||
GetDispatcher()->RegisterHandler(protocol::PacketType::SpawnMob, this);
|
||||
}
|
||||
|
||||
void WorldClient::HandlePacket(protocol::WorldBeginDataPacket* packet) {
|
||||
void WorldClient::HandlePacket(const protocol::WorldBeginDataPacket* packet) {
|
||||
loadMap(packet);
|
||||
}
|
||||
|
||||
void WorldClient::HandlePacket(protocol::WorldDataPacket* packet) {
|
||||
void WorldClient::HandlePacket(const protocol::WorldDataPacket* packet) {
|
||||
loadMap(packet);
|
||||
}
|
||||
|
||||
void WorldClient::HandlePacket(protocol::SpawnMobPacket* packet) {
|
||||
void WorldClient::HandlePacket(const protocol::SpawnMobPacket* packet) {
|
||||
spawnMobAt(packet->getMobID(), packet->getMobType(), packet->getMobLevel(), packet->getSender(),
|
||||
packet->getMobX(), packet->getMobY(), packet->getMobDirection());
|
||||
}
|
||||
|
||||
void WorldClient::HandlePacket(protocol::UpgradeTowerPacket* packet) {
|
||||
void WorldClient::HandlePacket(const protocol::UpgradeTowerPacket* packet) {
|
||||
game::TowerPtr tower = getTowerById(packet->getTowerID());
|
||||
if(tower == nullptr) return; // this should not happen but who knows ?
|
||||
tower->upgrade(packet->getTowerLevel().getLevel(), packet->getTowerLevel().getPath());
|
||||
|
||||
Reference in New Issue
Block a user