EffectSet EffectCategory::GetEffects(int type) const { EffectSet result; EffectSet::const_iterator iter; for (iter = mEffects.begin(); iter != mEffects.end(); ++iter) { int g = (*iter)->GetEffectFlags(); if ((g & type) == g) result.insert(*iter); } return result; }
// Return all the effects that belong to this immediate category or any // of its subcategories), filtered by effect type. EffectSet EffectCategory::GetAllEffects(int type) const { EffectSet result = GetEffects(type); CategorySet::const_iterator iter; for (iter = mSubCategories.begin(); iter != mSubCategories.end(); ++iter) { EffectSet tmp = (*iter)->GetAllEffects(type); EffectSet::const_iterator itr2; for (itr2 = tmp.begin(); itr2 != tmp.end(); ++itr2) result.insert(*itr2); } return result; }
EffectSet EffectManager::GetUnsortedEffects(int flags) const { if (flags == ALL_EFFECTS) return *mUnsorted; EffectSet result; EffectSet::const_iterator iter; for (iter = mUnsorted->begin(); iter != mUnsorted->end(); ++iter) { int g = (*iter)->GetEffectFlags(); if ((flags & g) == g) result.insert(*iter); } return result; }