nw::max_effects_of
-
template<typename T, typename It, typename Extractor = decltype(&effect_extract_int0)>
std::pair<T, It> nw::max_effects_of(It begin, It end, nw::EffectType type, int subtype, Versus vs = {}, Extractor extractor = &effect_extract_int0) 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
Extractor – A function that extracts a value of type
Tfrom an EffectHandle
- 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
extractor – A function that extracts the value from a particular effect.
- Returns:
(result, iterator)