/* * * Iter Vehemens ad Necem (IVAN) * Copyright (C) Timo Kiviluoto * Released under the GNU General * Public License * * See LICENSING which should be included * along with this file for more details * */ #ifndef __ILOOPS_H__ #define __ILOOPS_H__ #include "feloops.h" #include "char.h" struct combinebodypartpredicates : public combinepredicates { typedef combinepredicates base; truth operator()(const character* C, base::routine F, truth OrBit) const { return base::operator()(C, &character::GetBodyPart, F, C->GetBodyParts(), OrBit); } }; template struct combinebodypartpredicateswithparam : public combinepredicateswithparam { typedef combinepredicateswithparam base; truth operator()(const character* C, typename base::routine F, param P, truth OrBit) const { return base::operator()(C, &character::GetBodyPart, F, P, C->GetBodyParts(), OrBit); } }; struct combineequipmentpredicates : public combinepredicates { typedef combinepredicates base; truth operator()(const character* C, base::routine F, truth OrBit) const { return base::operator()(C, &character::GetEquipment, F, C->GetEquipments(), OrBit); } }; template struct combineequipmentpredicateswithparam : public combinepredicateswithparam { typedef combinepredicateswithparam base; truth operator()(const character* C, typename base::routine F, param P, truth OrBit) const { return base::operator()(C, &character::GetEquipment, F, P, C->GetEquipments(), OrBit); } }; struct doforbodyparts : public doforelements { typedef doforelements base; void operator()(const character* C, base::routine F) const { base::operator()(C, &character::GetBodyPart, F, C->GetBodyParts()); } }; template struct doforbodypartswithparam : public doforelementswithparam { typedef doforelementswithparam base; void operator()(const character* C, typename base::routine F, param P) const { base::operator()(C, &character::GetBodyPart, F, P, C->GetBodyParts()); } }; struct doforequipments : public doforelements { typedef doforelements base; void operator()(const character* C, base::routine F) const { base::operator()(C, &character::GetEquipment, F, C->GetEquipments()); } void operator()(const character* C, void (item::*F)() const) const { base::operator()(C, &character::GetEquipment, base::routine(F), C->GetEquipments()); } }; template struct doforequipmentswithparam : public doforelementswithparam { typedef doforelementswithparam base; void operator()(const character* C, typename base::routine F, param P) const { base::operator()(C, &character::GetEquipment, F, P, C->GetEquipments()); } void operator()(const character* C, void (item::*F)(param) const, param P) const { base::operator()(C, &character::GetEquipment, (typename base::routine)(F), P, C->GetEquipments()); } }; struct sumbodypartproperties : public sumproperties { typedef sumproperties base; int operator()(const character* C, base::routine F) const { return base::operator()(C, &character::GetBodyPart, F, C->GetBodyParts()); } }; template struct findequipment : public findelement { typedef findelement base; item* operator()(const character* C, typename base::routine F, param P) const { return base::operator()(C, &character::GetEquipment, F, P, C->GetEquipments()); } }; #endif