zZone Class Reference

#include <zZone.h>

Inheritance diagram for zZone:

Inheritance graph
[legend]
Collaboration diagram for zZone:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 zZone (eGrid *grid)
 local constructor
 zZone (nMessage &m)
 network constructor
 ~zZone ()
 destructor
void RemoveFromGame ()
 call this instead of the destructor
void SetReferenceTime ()
 sets the reference time to the current time
eCoord GetPosition (void) const
 Gets the current position.
zZone const & GetPosition (eCoord &position) const
 Gets the current position.
tCoord const GetRotation (void) const
 Gets the current rotation state.
REAL GetScale (void) const
 Gets the current scale.
rColor const GetColor (void) const
 Gets the current color.
void addEffectGroupEnter (zEffectGroupPtr anEffectGroup)
void addEffectGroupInside (zEffectGroupPtr anEffectGroup)
void addEffectGroupLeave (zEffectGroupPtr anEffectGroup)
void addEffectGroupOutside (zEffectGroupPtr anEffectGroup)
void setShape (zShapePtr aShape)
zShapePtr getShape ()
void setOldFortressAutomaticAssignmentBehavior (bool oldFortressAutomaticAssignmentBehavior)
bool getOldFortressAutomaticAssignmentBehavior ()
void setName (string name)
string getName ()

Protected Member Functions

virtual bool Timestep (REAL currentTime)
 simulates behaviour up to currentTime
virtual void OnVanish ()
 called when the zone vanishes

Protected Attributes

REAL createTime_
 the time the zone was created at
zShapePtr shape
 the shape(s) of this zone
REAL referenceTime_
 reference time for function evaluations
zEffectGroupPtrs effectGroupEnter
zEffectGroupPtrs effectGroupInside
zEffectGroupPtrs effectGroupLeave
zEffectGroupPtrs effectGroupOutside
std::set< ePlayerNetID * > playersInside
 The players that are currently inside the zone.
std::set< ePlayerNetID * > playersOutside
 The players that are currently outside the zone.

Private Member Functions

virtual void WriteCreate (nMessage &m)
 writes data for network constructor
virtual void WriteSync (nMessage &m)
 writes sync data
virtual void ReadSync (nMessage &m)
 reads sync data
virtual void InteractWith (eGameObject *target, REAL time, int recursion=1)
 looks for objects inzide the zone and reacts on them
void OnEnter (gCycle *target, REAL time)
 reacts on objects entering the zone
void OnLeave (gCycle *target, REAL time)
 reacts on objects leaving the zone
void OnInside (gCycle *target, REAL time)
 reacts on objects inside the zone
void OnOutside (gCycle *target, REAL time)
 reacts on objects outside the zone
virtual nDescriptorCreatorDescriptor () const
 returns the descriptor to recreate this object over the network
virtual void Render (const eCamera *cam)
 renders the zone
virtual void Render2D (tCoord scale) const
 renders the zone
REAL EvaluateFunctionNow (tFunction const &f) const
 evaluates the given function with lastTime - referenceTime_ as argument
void SetFunctionNow (tFunction &f, REAL value) const
 makes sure EvaluateFunctionNow() returns the given value
void RemoveFromZoneList (void)
 Removes the zone from the sg_Zones list if it's there.

Private Attributes

bool oldFortressAutomaticAssignmentBehavior_
string name_


Detailed Description

Definition at line 66 of file zZone.h.


Constructor & Destructor Documentation

zZone::zZone ( eGrid grid  ) 

local constructor

Parameters:
grid Grid to put the zone into
pos Position to spawn the zone at

Definition at line 102 of file zZone.cpp.

References eGameObject::AddToList(), createTime_, eSoundMixer::GetMixer(), eGameObject::lastTime, eGameObject::pos, eSoundMixer::PushButton(), referenceTime_, sz_Zones, and ZONE_SPAWN.

00103         :eNetGameObject( grid, eCoord(0,0), eCoord(0,0), NULL, true ),
00104         //        rotation_(1,0),
00105         effectGroupEnter(),
00106         effectGroupInside(),
00107         effectGroupLeave(),
00108         effectGroupOutside(),
00109         playersInside(),
00110         playersOutside(),
00111         oldFortressAutomaticAssignmentBehavior_(false),
00112         name_()
00113 {
00114     // store creation time
00115     referenceTime_ = createTime_ = lastTime = 0;
00116 
00117     // add to game grid
00118     this->AddToList();
00119 
00120     sz_Zones.push_back(this);
00121 
00122     // initialize position functions
00123     //    SetPosition( pos );
00124     eSoundMixer* mixer = eSoundMixer::GetMixer();
00125     mixer->PushButton(ZONE_SPAWN, pos);
00126 }

Here is the call graph for this function:

zZone::zZone ( nMessage m  ) 

network constructor

Parameters:
m Message to read creation data from

Definition at line 140 of file zZone.cpp.

References eGameObject::AddToList(), createTime_, eSoundMixer::GetMixer(), eGameObject::lastTime, eGameObject::pos, eSoundMixer::PushButton(), referenceTime_, sz_Zones, and ZONE_SPAWN.

00141         :eNetGameObject( m ),
00142         //rotation_(1,0),
00143         playersInside(),
00144         playersOutside(),
00145         oldFortressAutomaticAssignmentBehavior_(false),
00146         name_()
00147 {
00148     // read creation time
00149     m >> createTime_;
00150     referenceTime_ = lastTime = createTime_;
00151 
00152     // initialize color to white, ReadSync will fill in the true value if available
00153     //    color_.r_ = color_.g_ = color_.b_ = 1.0f;
00154 
00155     // add to game grid
00156     this->AddToList();
00157 
00158     sz_Zones.push_back(this);
00159 
00160     // initialize position functions
00161     //    SetPosition( pos );
00162     eSoundMixer* mixer = eSoundMixer::GetMixer();
00163     mixer->PushButton(ZONE_SPAWN, pos);
00164 
00165 
00166     /*
00167     shape = zShapePtr(new zShapeCircle(Grid(), ID()));
00168 
00169     tFunction asdf = tFunction();
00170     asdf.SetSlope(0.0);
00171     asdf.SetOffset(100.0);
00172     shape->setPosX(asdf);
00173     shape->setPosY(asdf);
00174     shape->setScale(asdf);
00175     shape->setRotation(asdf);
00176     shape->setScale(asdf);
00177     shape->setColor(rColor(0.7, 0.0, 0.7));
00178     zShapeCircle *circle = dynamic_cast<zShapeCircle *>( (zShape*)shape );
00179 
00180     circle->emulatingOldZone_ = true;
00181     */
00182 
00183     /*
00184     if (!m.End() && sz_ShapedZones.Supported() ) 
00185       {
00186         // Factory to make the shapes
00187         // HACK 
00188         // This makes them static for the life of the zone
00189         // rather than to re-send them all at each updates
00190         typedef zShape* (*shapeFactory)(nMessage &);
00191         std::map<tString, shapeFactory> shapes;
00192         // Build the list of supported shapes
00193         shapes[tString("circle")] = zShapeCircle::create;
00194         shapes[tString("polygon")] = zShapePolygon::create;
00195 
00196         // Get the name of the shape from the network
00197         tString shapeName;
00198         m >> shapeName;
00199         
00200         std::map<tString, shapeFactory>::const_iterator iterShapeFactory;
00201         // Build that shape if it is available
00202         if((iterShapeFactory = shapes.find(shapeName)) != shapes.end()) 
00203           {
00204             shape = zShapePtr((*(iterShapeFactory->second))(m));
00205           }
00206       }
00207     else
00208       {
00209         // Didnt receive a shape information. Assume we are talking to a 0.2.8- server
00210         shape = zShapePtr(new zShapeCircle());
00211         shape->setPosX(posx_);
00212         shape->setPosY(posy_);
00213         shape->setScale(scale_);
00214         tPolynomial<nMessage> tpRotationSpeed(2);
00215         tpRotationSpeed[0] = rotationSpeed_.GetOffset();
00216         tpRotationSpeed[0] = rotationSpeed_.GetOffset();
00217         shape->setRotation2(tpRotationSpeed);
00218         shape->setScale(scale_);
00219         shape->setColor(color_);
00220         
00221         emulateOldZoneShape = true;
00222       }
00223 */
00224 
00225 }

Here is the call graph for this function:

zZone::~zZone ( void   ) 

destructor

Definition at line 236 of file zZone.cpp.

References RemoveFromZoneList().

00237 {
00238     RemoveFromZoneList();
00239 }

Here is the call graph for this function:


Member Function Documentation

void zZone::RemoveFromGame ( void   ) 

call this instead of the destructor

Reimplemented from eGameObject.

Definition at line 241 of file zZone.cpp.

References eGameObject::RemoveFromGame(), and RemoveFromZoneList().

00241                                {
00242     RemoveFromZoneList();
00243     eNetGameObject::RemoveFromGame();
00244 }

Here is the call graph for this function:

void zZone::SetReferenceTime ( void   ) 

sets the reference time to the current time

Definition at line 758 of file zZone.cpp.

References eGameObject::lastTime, and referenceTime_.

00759 {
00760     // set offsets to current values
00761     /*
00762       this->posx_.SetOffset( EvaluateFunctionNow( this->posx_ ) );
00763       this->posy_.SetOffset( EvaluateFunctionNow( this->posy_ ) );
00764       this->scale_.SetOffset( EvaluateFunctionNow( this->scale_ ) );
00765       this->rotationSpeed_.SetOffset( EvaluateFunctionNow( this->rotationSpeed_ ) );
00766     */
00767     // reset time
00768     this->referenceTime_ = lastTime;
00769 }

eCoord zZone::GetPosition ( void   )  const

Gets the current position.

Returns:
the current position

Definition at line 695 of file zZone.cpp.

References eCoord.

00696 {
00697     // HACK, to be implemented later and differently
00698     // Should get this info from the shape, not the zone
00699     eCoord ret;
00700     GetPosition( ret );
00701     return ret;
00702 }

zZone const & zZone::GetPosition ( eCoord &  position  )  const

Gets the current position.

Parameters:
position the current position to fill
Returns:
A reference to this to allow chaining

Definition at line 715 of file zZone.cpp.

References EvaluateFunctionNow().

00716 {
00717     if(0 != shape) {
00718         position.x = EvaluateFunctionNow( shape->getPosX() );
00719         position.y = EvaluateFunctionNow( shape->getPosY() );
00720     }
00721     return *this;
00722 }

Here is the call graph for this function:

tCoord const zZone::GetRotation ( void   )  const

Gets the current rotation state.

Returns:
The current rotation position, as normalized x and y coordinates

Definition at line 781 of file zZone.cpp.

00782 {
00783     // HACK, to be implemented later and differently
00784     // Should get this info from the shape, not the zone
00785     return tCoord(0.0, 0.0);
00786 }

REAL zZone::GetScale ( void   )  const

Gets the current scale.

Returns:
the current scale

Definition at line 734 of file zZone.cpp.

References EvaluateFunctionNow(), and REAL.

00735 {
00736     //    REAL ret = EvaluateFunctionNow( this->scale_ );
00737     //    ret = ret > 0 ? ret : 0;
00738 
00739 
00740     // HACK, to be implemented later and differently
00741     // Should get this info from the shape, not the zone
00742     REAL scale = 0.0;
00743     if(0 != shape) {
00744         scale = EvaluateFunctionNow( shape->getScale() ) ;
00745     }
00746     return scale;
00747 }

Here is the call graph for this function:

rColor const zZone::GetColor ( void   )  const

Gets the current color.

Returns:
the current color of the zone

Definition at line 798 of file zZone.cpp.

00799 {
00800     rColor color;
00801     if(0 != shape) {
00802         color = shape->getColor();
00803     }
00804     return color;
00805 }

void zZone::addEffectGroupEnter ( zEffectGroupPtr  anEffectGroup  )  [inline]

Definition at line 103 of file zZone.h.

References effectGroupEnter.

00103 {effectGroupEnter.push_back  (anEffectGroup);};

void zZone::addEffectGroupInside ( zEffectGroupPtr  anEffectGroup  )  [inline]

Definition at line 104 of file zZone.h.

References effectGroupInside.

00104 {effectGroupInside.push_back (anEffectGroup);};

void zZone::addEffectGroupLeave ( zEffectGroupPtr  anEffectGroup  )  [inline]

Definition at line 105 of file zZone.h.

References effectGroupLeave.

00105 {effectGroupLeave.push_back  (anEffectGroup);};

void zZone::addEffectGroupOutside ( zEffectGroupPtr  anEffectGroup  )  [inline]

Definition at line 106 of file zZone.h.

References effectGroupOutside.

00106 {effectGroupOutside.push_back(anEffectGroup);};

void zZone::setShape ( zShapePtr  aShape  )  [inline]

Definition at line 108 of file zZone.h.

Referenced by zShape::joinWithZone().

00108 { shape = aShape; };

Here is the caller graph for this function:

zShapePtr zZone::getShape (  )  [inline]

Definition at line 109 of file zZone.h.

00109 { return shape; };

void zZone::setOldFortressAutomaticAssignmentBehavior ( bool  oldFortressAutomaticAssignmentBehavior  )  [inline]

Definition at line 113 of file zZone.h.

References oldFortressAutomaticAssignmentBehavior_.

00114     {
00115         oldFortressAutomaticAssignmentBehavior_ = oldFortressAutomaticAssignmentBehavior;
00116     };

bool zZone::getOldFortressAutomaticAssignmentBehavior (  )  [inline]

Definition at line 117 of file zZone.h.

References oldFortressAutomaticAssignmentBehavior_.

void zZone::setName ( string  name  )  [inline]

Definition at line 119 of file zZone.h.

References name_.

00119 {name_ = name;};

string zZone::getName (  )  [inline]

Definition at line 120 of file zZone.h.

References name_.

00120 { return name_; };

bool zZone::Timestep ( REAL  time  )  [protected, virtual]

simulates behaviour up to currentTime

Parameters:
time the current time

Reimplemented from eNetGameObject.

Definition at line 440 of file zZone.cpp.

References eGameObject::lastTime.

00441 {
00442     if(0 != shape) {
00443         shape->TimeStep( time );
00444     }
00445     /*
00446        if(!emulateOldZoneShape) {
00447            shape->TimeStep( time );
00448        }
00449        else { // Old representation of zone
00450        // rotate
00451        REAL speed = GetRotationSpeed();
00452        REAL angle = ( time - lastTime ) * speed;
00453        // angle /= ( 1 + 2 * 3.14159 * angle/sg_segments );
00454        rotation_ = rotation_.Turn( cos( angle ), sin( angle ) );
00455 
00456        // move to new position
00457        REAL dt = time - referenceTime_;
00458        Move( eCoord( posx_( dt ), posy_( dt ) ), lastTime, time );
00459        
00460 
00461        // kill this zone if it shrunk down to zero scale
00462        if ( GetExpansionSpeed() < 0 && GetScale() <= 0 )
00463        {
00464            OnVanish();
00465            return true;
00466        }
00467        }
00468        // update time
00469        */
00470     lastTime = time;
00471 
00472     return false;
00473 }

void zZone::OnVanish ( void   )  [protected, virtual]

called when the zone vanishes

Definition at line 484 of file zZone.cpp.

00485 {
00486 }

void zZone::WriteCreate ( nMessage m  )  [private, virtual]

writes data for network constructor

Parameters:
m Message to write creation data to

Reimplemented from eNetGameObject.

Definition at line 269 of file zZone.cpp.

References createTime_, and eNetGameObject::WriteCreate().

00270 {
00271     // delegate
00272     eNetGameObject::WriteCreate( m );
00273 
00274     m << createTime_;
00275 
00276     /*
00277     if(!emulateOldZoneShape && sz_ShapedZones.Supported() )
00278       shape->WriteCreate( m );
00279     */
00280 }

Here is the call graph for this function:

void zZone::WriteSync ( nMessage m  )  [private, virtual]

writes sync data

Parameters:
m Message to write sync data to

Reimplemented from eNetGameObject.

Definition at line 292 of file zZone.cpp.

References referenceTime_, and eNetGameObject::WriteSync().

00293 {
00294     // delegate
00295     eNetGameObject::WriteSync( m );
00296 
00297     /*
00298     // write color
00299     m << color_.r_;
00300     m << color_.g_;
00301     m << color_.b_;
00302 
00303     // write reference time and functions
00304     m << referenceTime_;
00305     m << posx_;
00306     m << posy_;
00307     m << scale_;
00308 
00309     // write rotation speed
00310     m << rotationSpeed_;
00311     */
00312 
00313     // Simply populate the message with semi-meaningful data
00314     m << shape->getColor().r_;
00315     m << shape->getColor().g_;
00316     m << shape->getColor().b_;
00317 
00318     m << referenceTime_;
00319 
00320     m << shape->getPosX();
00321     m << shape->getPosY();
00322     m << shape->getScale();
00323     // shape->getRotation no longer exist. Fake it!
00324     tFunction tfFakedRotation;
00325     m << tfFakedRotation;
00326 
00327     m << shape->ID();
00328 }

Here is the call graph for this function:

void zZone::ReadSync ( nMessage m  )  [private, virtual]

reads sync data

Parameters:
m Message to read sync data from

Reimplemented from eNetGameObject.

Definition at line 340 of file zZone.cpp.

References b, tColor::b_, createTime_, nMessage::End(), tColor::g_, tFunction::GetOffset(), tFunction::GetSlope(), eGameObject::pos, tColor::r_, eNetGameObject::ReadSync(), referenceTime_, se_MakeColorValid(), tFunction::SetOffset(), tFunction::SetSlope(), sg_expansionSpeed, sg_initialSize, and sn_netObjects.

00341 {
00342     // delegage
00343     eNetGameObject::ReadSync( m );
00344 
00345     if(shape && shape->isEmulatingOldZone())
00346     {
00347         // read color
00348         rColor aColor(0.0, 0.7, 0.5);
00349         if (!m.End())
00350         {
00351             m >> aColor.r_;
00352             m >> aColor.g_;
00353             m >> aColor.b_;
00354         }
00355         se_MakeColorValid(aColor.r_, aColor.g_, aColor.b_, 1.0f);
00356         shape->setColor(aColor);
00357 
00358         // read reference time and functions
00359         if (!m.End())
00360         {
00361             m >> referenceTime_;
00362             shape->setReferenceTime(referenceTime_);
00363             if (!m.End())
00364             {
00365                 tFunction aFunc;
00366                 m >> aFunc;
00367                 shape->setPosX(aFunc);
00368                 m >> aFunc;
00369                 shape->setPosY(aFunc);
00370                 m >> aFunc;
00371                 shape->setScale(aFunc);
00372             }
00373         }
00374         else
00375         {
00376             // Uses values from the eNetGameObject
00377             referenceTime_ = createTime_;
00378             shape->setReferenceTime(referenceTime_);
00379 
00380             tFunction aFunc;
00381             aFunc.SetOffset( pos.x );
00382             aFunc.SetSlope( 0 );
00383             shape->setPosX( aFunc );
00384 
00385             aFunc.SetOffset( pos.y );
00386             aFunc.SetSlope( 0 );
00387             shape->setPosY( aFunc );
00388 
00389             aFunc.SetOffset( sg_initialSize );
00390             aFunc.SetSlope( sg_expansionSpeed );
00391             shape->setScale( aFunc );
00392         }
00393 
00394         // read rotation speed
00395         tFunction rotationSpeed;
00396         if (!m.End())
00397         {
00398             m >> rotationSpeed;
00399         }
00400         else
00401         {
00402             // set fixed values
00403             rotationSpeed.SetOffset( .3f );
00404             rotationSpeed.SetSlope( 0.0f );
00405         }
00406         tPolynomial<nMessage> tpRotationSpeed(2);
00407         tpRotationSpeed[0] = rotationSpeed.GetOffset();
00408         tpRotationSpeed[1] = rotationSpeed.GetSlope();
00409         shape->setRotation2(tpRotationSpeed);
00410     }
00411     else
00412     {
00413         bool b;
00414 
00415         //        while(!m.End() ) { m >> b;}
00416 
00417         int count=44-16;
00418         // Discard the information
00419         while(!m.End() && count-->0) { m >> b;}
00420         unsigned short shapeID;
00421         m >> shapeID;
00422         if(sn_netObjects[shapeID]) {
00423             // zShape *asdf = dynamic_cast<zShape*>(&*sn_netObjects[shapeID]);
00424             shape = zShapePtr( dynamic_cast<zShape*>(&*sn_netObjects[shapeID]) );
00425         }
00426 
00427     }
00428 }

Here is the call graph for this function:

void zZone::InteractWith ( eGameObject target,
REAL  time,
int  recursion = 1 
) [private, virtual]

looks for objects inzide the zone and reacts on them

Parameters:
target the other game object
time the current time
recursion if set to true, don't recurse into other InteractWith functions (quite silly now that I think about it...)

Reimplemented from eGameObject.

Definition at line 500 of file zZone.cpp.

References gCycleMovement::Alive(), OnEnter(), OnInside(), OnLeave(), OnOutside(), eNetGameObject::Player(), playersInside, and playersOutside.

00501 {
00502     gCycle* prey = dynamic_cast< gCycle* >( target );
00503     if ( prey && 0 != shape)
00504     {
00505         if ( prey->Player() && prey->Alive() )
00506         {
00507             // Is the player inside or outside the zone
00508             if ( shape->isInteracting(target) == true )
00509             {
00510                 // If the player is not on the "inside" list, then he was outside
00511                 std::set<ePlayerNetID *>::iterator iter;
00512                 if ((iter = playersInside.find(prey->Player()) ) == playersInside.end()) {
00513                     playersInside.insert(prey->Player());
00514 
00515                     // Should the player not be marked as being outside
00516                     // avoid the OnEnter transition. This happens at game
00517                     // start-up for example, when players are neither inside nor outside
00518                     if( playersOutside.find(prey->Player()) != playersOutside.end() )
00519                     {
00520                         // Passing from outside to inside triggers the OnEnter event
00521                         OnEnter( prey, time );
00522                     }
00523                     // The player is no longer outside
00524                     playersOutside.erase(prey->Player());
00525                 }
00526                 // Being inside gives the OnInside event
00527                 OnInside( prey, time );
00528             }
00529             else {
00530                 // If the player is not on the "outside" list, then he was inside
00531                 std::set<ePlayerNetID *>::iterator iter;
00532                 if ((iter = playersOutside.find(prey->Player())) == playersOutside.end()) {
00533                     playersOutside.insert(prey->Player());
00534 
00535                     // Should the player not be marked as being inside
00536                     // avoid OnLeave transition. This happens at game
00537                     // start-up for example, when players are neither inside nor outside
00538                     if( playersInside.find(prey->Player()) != playersInside.end() )
00539                     {
00540                         // Passing from inside to outside triggers the OnLeave event
00541                         OnLeave( prey, time );
00542                     }
00543                     // The player is no longer inside
00544                     playersInside.erase(prey->Player());
00545                 }
00546                 // Being inside gives the OnOutside event
00547                 OnOutside( prey, time );
00548             }
00549         }
00550     }
00551 }

Here is the call graph for this function:

void zZone::OnEnter ( gCycle target,
REAL  time 
) [private]

reacts on objects entering the zone

Parameters:
target the cycle that has been found inside the zone
time the current time

Definition at line 565 of file zZone.cpp.

References _ignore, effectGroupEnter, Triggerer::marked, Triggerer::positive, tpOne, and Triggerer::who.

Referenced by InteractWith().

00566 {
00567     Triggerer triggerer;
00568     triggerer.who = target;
00569     triggerer.positive = _ignore;
00570     triggerer.marked = _ignore;
00571 
00572     zEffectGroupPtrs::const_iterator iter;
00573     for (iter = effectGroupEnter.begin();
00574             iter != effectGroupEnter.end();
00575             ++iter)
00576     {
00577         (*iter)->apply(triggerer, time, tpOne);
00578     }
00579 }

Here is the caller graph for this function:

void zZone::OnLeave ( gCycle target,
REAL  time 
) [private]

reacts on objects leaving the zone

Definition at line 596 of file zZone.cpp.

References _ignore, effectGroupLeave, Triggerer::marked, Triggerer::positive, tpOne, and Triggerer::who.

Referenced by InteractWith().

00597 {
00598     Triggerer triggerer;
00599     triggerer.who = target;
00600     triggerer.positive = _ignore;
00601     triggerer.marked = _ignore;
00602 
00603     zEffectGroupPtrs::const_iterator iter;
00604     for (iter = effectGroupLeave.begin();
00605             iter != effectGroupLeave.end();
00606             ++iter)
00607     {
00608         (*iter)->apply(triggerer, time, tpOne);
00609     }
00610 }

Here is the caller graph for this function:

void zZone::OnInside ( gCycle target,
REAL  time 
) [private]

reacts on objects inside the zone

Definition at line 581 of file zZone.cpp.

References _ignore, effectGroupInside, Triggerer::marked, Triggerer::positive, tpOne, and Triggerer::who.

Referenced by InteractWith().

00582 {
00583     Triggerer triggerer;
00584     triggerer.who = target;
00585     triggerer.positive = _ignore;
00586     triggerer.marked = _ignore;
00587 
00588     zEffectGroupPtrs::const_iterator iter;
00589     for (iter = effectGroupInside.begin();
00590             iter != effectGroupInside.end();
00591             ++iter)
00592     {
00593         (*iter)->apply(triggerer, time, tpOne);
00594     }
00595 }

Here is the caller graph for this function:

void zZone::OnOutside ( gCycle target,
REAL  time 
) [private]

reacts on objects outside the zone

Definition at line 611 of file zZone.cpp.

References _ignore, effectGroupOutside, Triggerer::marked, Triggerer::positive, tpOne, and Triggerer::who.

Referenced by InteractWith().

00612 {
00613     Triggerer triggerer;
00614     triggerer.who = target;
00615     triggerer.positive = _ignore;
00616     triggerer.marked = _ignore;
00617 
00618     zEffectGroupPtrs::const_iterator iter;
00619     for (iter = effectGroupOutside.begin();
00620             iter != effectGroupOutside.end();
00621             ++iter)
00622     {
00623         (*iter)->apply(triggerer, time, tpOne);
00624     }
00625 }

Here is the caller graph for this function:

nDescriptor & zZone::CreatorDescriptor ( void   )  const [private, virtual]

returns the descriptor to recreate this object over the network

Returns:

Implements nNetObject.

Definition at line 640 of file zZone.cpp.

References zone_init.

00641 {
00642     return zone_init;
00643 }

void zZone::Render ( const eCamera cam  )  [private, virtual]

renders the zone

Parameters:
cam the camera used for rendering

Reimplemented from eGameObject.

Definition at line 673 of file zZone.cpp.

00674 {
00675     if (shape)
00676         shape->render(cam);
00677 }

void zZone::Render2D ( tCoord  scale  )  const [private, virtual]

renders the zone

Reimplemented from eGameObject.

Definition at line 679 of file zZone.cpp.

00679                                          {
00680     if (shape)
00681         shape->render2d(scale);
00682 }

REAL zZone::EvaluateFunctionNow ( tFunction const &  f  )  const [inline, private]

evaluates the given function with lastTime - referenceTime_ as argument

Parameters:
f function to evaluate
Returns:
the function's value at lastTime - referenceTime_

Definition at line 71 of file zZone.cpp.

References eGameObject::lastTime, and referenceTime_.

Referenced by GetPosition(), and GetScale().

00072 {
00073     return f( lastTime - referenceTime_ );
00074 }

Here is the caller graph for this function:

void zZone::SetFunctionNow ( tFunction f,
REAL  value 
) const [inline, private]

makes sure EvaluateFunctionNow() returns the given value

Parameters:
f function to modify
value value the function should have at lastTime - referenceTime_

Definition at line 87 of file zZone.cpp.

References tFunction::GetSlope(), eGameObject::lastTime, referenceTime_, and tFunction::SetOffset().

00088 {
00089     f.SetOffset( value + f.GetSlope() * ( referenceTime_ - lastTime ) );
00090 }

Here is the call graph for this function:

void zZone::RemoveFromZoneList ( void   )  [private]

Removes the zone from the sg_Zones list if it's there.

Definition at line 246 of file zZone.cpp.

References sz_Zones.

Referenced by RemoveFromGame(), and ~zZone().

00246                                    {
00247     std::deque<zZone *>::iterator pos_found =
00248         std::find_if(
00249             sz_Zones.begin(),
00250             sz_Zones.end(),
00251             std::bind2nd(
00252                 std::equal_to<zZone *>(),
00253                 this)
00254         );
00255     if(pos_found != sz_Zones.end())
00256         sz_Zones.erase(pos_found);
00257 }

Here is the caller graph for this function:


Member Data Documentation

REAL zZone::createTime_ [protected]

the time the zone was created at

Definition at line 120 of file zZone.h.

Referenced by ReadSync(), WriteCreate(), and zZone().

zShapePtr zZone::shape [protected]

the shape(s) of this zone

Definition at line 125 of file zZone.h.

REAL zZone::referenceTime_ [protected]

reference time for function evaluations

Definition at line 127 of file zZone.h.

Referenced by EvaluateFunctionNow(), ReadSync(), SetFunctionNow(), SetReferenceTime(), WriteSync(), and zZone().

zEffectGroupPtrs zZone::effectGroupEnter [protected]

Definition at line 139 of file zZone.h.

Referenced by addEffectGroupEnter(), and OnEnter().

zEffectGroupPtrs zZone::effectGroupInside [protected]

Definition at line 140 of file zZone.h.

Referenced by addEffectGroupInside(), and OnInside().

zEffectGroupPtrs zZone::effectGroupLeave [protected]

Definition at line 141 of file zZone.h.

Referenced by addEffectGroupLeave(), and OnLeave().

zEffectGroupPtrs zZone::effectGroupOutside [protected]

Definition at line 142 of file zZone.h.

Referenced by addEffectGroupOutside(), and OnOutside().

std::set<ePlayerNetID *> zZone::playersInside [protected]

The players that are currently inside the zone.

Definition at line 144 of file zZone.h.

Referenced by InteractWith().

std::set<ePlayerNetID *> zZone::playersOutside [protected]

The players that are currently outside the zone.

Definition at line 145 of file zZone.h.

Referenced by InteractWith().

bool zZone::oldFortressAutomaticAssignmentBehavior_ [private]

Definition at line 171 of file zZone.h.

Referenced by getOldFortressAutomaticAssignmentBehavior(), and setOldFortressAutomaticAssignmentBehavior().

string zZone::name_ [private]

Definition at line 173 of file zZone.h.

Referenced by getName(), and setName().


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