#include <zMonitor.h>
Public Member Functions | |
zMonitorRule () | |
virtual bool | isValid (float monitorValue) |
virtual | ~zMonitorRule () |
void | addEffectGroup (zEffectGroupPtr anEffectGroupPtr) |
void | applyRule (triggerers &contributors, REAL time, const tPolynomial< nMessage > &valueEq) |
void | addMonitorInfluence (zMonitorInfluencePtr newInfluence) |
void | addZoneInfluence (zZoneInfluencePtr aZoneInfluencePtr) |
Protected Attributes | |
zEffectGroupPtrs | effectGroupList |
zMonitorInfluencePtrs | monitorInfluences |
zZoneInfluencePtrs | zoneInfluences |
Definition at line 98 of file zMonitor.h.
zMonitorRule::zMonitorRule | ( | ) | [inline] |
virtual zMonitorRule::~zMonitorRule | ( | ) | [inline, virtual] |
virtual bool zMonitorRule::isValid | ( | float | monitorValue | ) | [inline, virtual] |
Reimplemented in zMonitorRuleOver, zMonitorRuleUnder, zMonitorRuleInRange, and zMonitorRuleOutsideRange.
Definition at line 101 of file zMonitor.h.
void zMonitorRule::addEffectGroup | ( | zEffectGroupPtr | anEffectGroupPtr | ) | [inline] |
Definition at line 106 of file zMonitor.h.
References effectGroupList.
00106 { 00107 effectGroupList.push_back(anEffectGroupPtr); 00108 };
void zMonitorRule::applyRule | ( | triggerers & | contributors, | |
REAL | time, | |||
const tPolynomial< nMessage > & | valueEq | |||
) |
Definition at line 101 of file zMonitor.cpp.
References effectGroupList, monitorInfluences, and zoneInfluences.
00101 { 00102 /* We take all the contributors */ 00103 /* And apply the proper effect */ 00104 00105 // Go through all effectgroups (owners of some action) 00106 std::vector<zEffectGroupPtr>::iterator iter; 00107 for (iter = effectGroupList.begin(); 00108 iter != effectGroupList.end(); 00109 ++iter) 00110 { 00111 // Go through all the categories of triggerer (ie: people who have right to trigger an action) 00112 triggerers::const_iterator iter2; 00113 for (iter2 = contributors.begin(); 00114 iter2 != contributors.end(); 00115 ++iter2) 00116 { 00117 (*iter)->apply(*iter2, time, valueEq); 00118 } 00119 } 00120 00121 gVectorExtra< nNetObjectID > owners; 00122 gVectorExtra< nNetObjectID > teamOwners; 00123 00124 zMonitorInfluencePtrs::const_iterator iterMonitorInfluence; 00125 for (iterMonitorInfluence=monitorInfluences.begin(); 00126 iterMonitorInfluence!=monitorInfluences.end(); 00127 ++iterMonitorInfluence) 00128 { 00129 // TODO: pass the whole valueEq 00130 (*iterMonitorInfluence)->apply(owners, teamOwners, (gCycle*)0, valueEq); 00131 } 00132 00133 zZoneInfluencePtrs::const_iterator iterZoneInfluence; 00134 for (iterZoneInfluence=zoneInfluences.begin(); 00135 iterZoneInfluence!=zoneInfluences.end(); 00136 ++iterZoneInfluence) 00137 { 00138 (*iterZoneInfluence)->apply(valueEq); 00139 } 00140 }
void zMonitorRule::addMonitorInfluence | ( | zMonitorInfluencePtr | newInfluence | ) | [inline] |
Definition at line 111 of file zMonitor.h.
References monitorInfluences.
00111 { 00112 monitorInfluences.push_back( newInfluence ); 00113 };
void zMonitorRule::addZoneInfluence | ( | zZoneInfluencePtr | aZoneInfluencePtr | ) | [inline] |
Definition at line 114 of file zMonitor.h.
References zoneInfluences.
00114 { 00115 zoneInfluences.push_back(aZoneInfluencePtr); 00116 };
zEffectGroupPtrs zMonitorRule::effectGroupList [protected] |
zMonitorInfluencePtrs zMonitorRule::monitorInfluences [protected] |
zZoneInfluencePtrs zMonitorRule::zoneInfluences [protected] |