Added HasVolatileScript function to Creature and Battle.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
4728be18b2
commit
3802587313
|
@ -131,3 +131,4 @@ void Battle::AddVolatileScript(const std::string& key) {
|
|||
void Battle::AddVolatileScript(Script* script) { return _volatile.Add(script); }
|
||||
void Battle::RemoveVolatileScript(const std::string& name) { _volatile.Remove(name); }
|
||||
void Battle::RemoveVolatileScript(Script* script) { _volatile.Remove(script->GetName()); }
|
||||
void Battle::HasVolatileScript(const std::string& name) const { _volatile.Has(name); }
|
||||
|
|
|
@ -80,6 +80,7 @@ namespace CreatureLib::Battling {
|
|||
void AddVolatileScript(Script* script);
|
||||
void RemoveVolatileScript(const std::string& name);
|
||||
void RemoveVolatileScript(Script* script);
|
||||
void HasVolatileScript(const std::string& name) const;
|
||||
|
||||
void RegisterEventListener(EVENT_HOOK_FUNC(listener)) { this->_eventHook.RegisterListener(listener); }
|
||||
void TriggerEventListener(EventData* data) { this->_eventHook.TriggerEvent(data); }
|
||||
|
|
|
@ -198,3 +198,4 @@ void Battling::Creature::AddVolatileScript(const std::string& name) {
|
|||
void Battling::Creature::AddVolatileScript(Script* script) { _volatile.Add(script); }
|
||||
void Battling::Creature::RemoveVolatileScript(const std::string& name) { _volatile.Remove(name); }
|
||||
void Battling::Creature::RemoveVolatileScript(Battling::Script* script) { _volatile.Remove(script->GetName()); }
|
||||
void Battling::Creature::HasVolatileScript(const std::string& name) const { _volatile.Has(name); }
|
||||
|
|
|
@ -120,6 +120,7 @@ namespace CreatureLib::Battling {
|
|||
void AddVolatileScript(Script* script);
|
||||
void RemoveVolatileScript(const std::string& name);
|
||||
void RemoveVolatileScript(Script* script);
|
||||
void HasVolatileScript(const std::string& name) const;
|
||||
|
||||
std::vector<LearnedAttack*>& GetAttacks() { return _attacks; }
|
||||
|
||||
|
|
|
@ -55,6 +55,11 @@ namespace CreatureLib::Battling {
|
|||
_lookup.clear();
|
||||
}
|
||||
|
||||
bool Has(const std::string& key) {
|
||||
auto find = _lookup.find(key);
|
||||
return find != _lookup.end();
|
||||
}
|
||||
|
||||
size_t Count() const { return _scripts.size(); }
|
||||
|
||||
const std::vector<Script*>* GetIterator() const { return &_scripts; }
|
||||
|
|
Loading…
Reference in New Issue