zMonitorRule Class Reference

#include <zMonitor.h>

Inheritance diagram for zMonitorRule:

Inheritance graph
[legend]

List of all members.

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


Detailed Description

Definition at line 98 of file zMonitor.h.


Constructor & Destructor Documentation

zMonitorRule::zMonitorRule (  )  [inline]

Definition at line 100 of file zMonitor.h.

00100 { };

virtual zMonitorRule::~zMonitorRule (  )  [inline, virtual]

Definition at line 104 of file zMonitor.h.

00104 { };


Member Function Documentation

virtual bool zMonitorRule::isValid ( float  monitorValue  )  [inline, virtual]

Reimplemented in zMonitorRuleOver, zMonitorRuleUnder, zMonitorRuleInRange, and zMonitorRuleOutsideRange.

Definition at line 101 of file zMonitor.h.

00101                                              {
00102         return true;
00103     }; // Should the rule be activated

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     };


Member Data Documentation

zEffectGroupPtrs zMonitorRule::effectGroupList [protected]

Definition at line 116 of file zMonitor.h.

Referenced by addEffectGroup(), and applyRule().

zMonitorInfluencePtrs zMonitorRule::monitorInfluences [protected]

Definition at line 120 of file zMonitor.h.

Referenced by addMonitorInfluence(), and applyRule().

zZoneInfluencePtrs zMonitorRule::zoneInfluences [protected]

Definition at line 121 of file zMonitor.h.

Referenced by addZoneInfluence(), and applyRule().


The documentation for this class was generated from the following files:
Generated on Sun Mar 16 00:01:45 2008 for Armagetron Advanced by  doxygen 1.5.4