1
This commit is contained in:
parent
7cf4a4f324
commit
03e289906e
@ -371,7 +371,12 @@ void Trigger::RemoveBuffs(int cond, std::vector<int>& buffids)
|
||||
}
|
||||
}
|
||||
|
||||
void Trigger::AddListener(int event_id, std::function<void(const a8::XParams&)> cb)
|
||||
std::weak_ptr<EventHandler> Trigger::AddListener(int event_id, std::function<void(const a8::XParams&)> cb)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Trigger::RemoveEventHandler(std::weak_ptr<EventHandler> handler)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,12 @@ namespace MetaData
|
||||
struct Equip;
|
||||
};
|
||||
|
||||
struct EventHandler
|
||||
{
|
||||
std::function<void(const a8::XParams&)> cb;
|
||||
list_head entry;
|
||||
};
|
||||
|
||||
class Weapon;
|
||||
class Creature;
|
||||
class Skill;
|
||||
@ -28,7 +34,8 @@ public:
|
||||
void Die();
|
||||
void ActiveBuff(MetaData::Buff* buff_meta);
|
||||
void DeactiveBuff(MetaData::Buff* buff_meta);
|
||||
void AddListener(int event_id, std::function<void(const a8::XParams&)> cb);
|
||||
std::weak_ptr<EventHandler> AddListener(int event_id, std::function<void(const a8::XParams&)> cb);
|
||||
void RemoveEventHandler(std::weak_ptr<EventHandler> handler);
|
||||
|
||||
private:
|
||||
void TraverseCondBuffs(int cond, std::function<void (Buff*, bool&)> func);
|
||||
@ -41,5 +48,5 @@ public:
|
||||
private:
|
||||
Creature* owner_ = nullptr;
|
||||
int kill_num_ = 0;
|
||||
std::map<int, std::function<void(const a8::XParams&)>> listeners_hash_;
|
||||
std::map<int, list_head> listeners_hash_;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user