feat: add mob spawn notification

This commit is contained in:
2021-12-11 19:56:03 +01:00
parent a241d7691b
commit c4a2b08416

View File

@@ -114,6 +114,7 @@ void World::spawnMobAt(MobID id, MobType type, std::uint8_t level, PlayerID send
mob->setCenter({ x, y }); mob->setCenter({ x, y });
mob->setDirection(dir); mob->setDirection(dir);
m_Mobs.push_back(mob); m_Mobs.push_back(mob);
getMobNotifier().notifyListeners(&MobListener::OnMobSpawn, mob.get());
} }
TowerPtr World::placeTowerAt(TowerID id, TowerType type, std::int32_t x, std::int32_t y, PlayerID builder) { TowerPtr World::placeTowerAt(TowerID id, TowerType type, std::int32_t x, std::int32_t y, PlayerID builder) {