nw::resolve_effects_of
-
template<typename T, typename It, typename CallBack, typename Extractor, typename Comp = std::greater<T>>
It nw::resolve_effects_of(It begin, It end, nw::EffectType type, int subtype, Versus vs, CallBack cb, Extractor extractor, Comp comparator = std::greater<T>{}) noexcept Finds all applicable effects of a given type / subtype.
Applicable effects are passed to a user supplied callback.
- Template Parameters:
T – An arbitrary type that can be held in an effect, e.g. a simple integer, a damage roll, etc.
It – An iterator type
CallBack – A function with the signature void(T) supplied by the user
Extractor – A function that extracts a value of type
Tfrom an EffectHandleComp – A comparator taking two
Tvalues and returnstrueif the first is greater (Default std::greater<T>)
- Parameters:
begin – Start of a range of effect handles of a type/subtype
end – End range of effect handles
type – An effect_type_* constant
subtype – A effect subtype, if no subtype -1 should be passed
vs – Versus struct
cb – A user defined callback that will be passed an applicable effect’s value.
extractor – A function that extracts the value from a particular effect.
comparator – A function taking two
Tvalues and returnstrueif the first is greater (Default std::greater<T>)
- Returns:
iterator to passed last processed effect