refactor: separate mob ans world listener
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "Types.h"
|
||||
#include "Team.h"
|
||||
|
||||
#include "misc/ObjectNotifier.h"
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
@@ -218,6 +220,18 @@ MobPtr createMob(MobID id, MobType type, std::uint8_t level, PlayerID sender);
|
||||
std::string getMobName(MobType type);
|
||||
}
|
||||
|
||||
class MobListener {
|
||||
public:
|
||||
virtual void OnMobSpawn(MobPtr mob) {}
|
||||
virtual void OnMobDie(MobPtr mob) {}
|
||||
|
||||
virtual void OnMobDamage(MobPtr target, float damage, Tower* damager) {}
|
||||
|
||||
virtual void OnMobTouchCastle(MobPtr damager, TeamCastle* enemyCastle) {}
|
||||
virtual void OnMobCastleDamage(MobPtr damager, TeamCastle* enemyCastle) {}
|
||||
};
|
||||
|
||||
typedef utils::ObjectNotifier<MobListener> MobNotifier;
|
||||
|
||||
} // namespace game
|
||||
} // namespace td
|
||||
|
||||
Reference in New Issue
Block a user