zSelectorSingleDeadOwner Class Reference

#include <zSelector.h>

Inheritance diagram for zSelectorSingleDeadOwner:

Inheritance graph
[legend]
Collaboration diagram for zSelectorSingleDeadOwner:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 zSelectorSingleDeadOwner ()
 zSelectorSingleDeadOwner (zSelectorSingleDeadOwner const &other)
void operator= (zSelectorSingleDeadOwner const &other)
 overloaded assignment operator
virtual zSelectorSingleDeadOwnercopy (void) const
virtual ~zSelectorSingleDeadOwner ()
gVectorExtra< ePlayerNetID * > select (gVectorExtra< nNetObjectID > &owners, gVectorExtra< nNetObjectID > &teamOwners, gCycle *triggerer)

Static Public Member Functions

static zSelectorcreate ()


Detailed Description

Definition at line 290 of file zSelector.h.


Constructor & Destructor Documentation

zSelectorSingleDeadOwner::zSelectorSingleDeadOwner (  ) 

Definition at line 678 of file zSelector.cpp.

Referenced by copy(), and create().

00678                                                   :
00679         zSelector()
00680 { }

Here is the caller graph for this function:

zSelectorSingleDeadOwner::zSelectorSingleDeadOwner ( zSelectorSingleDeadOwner const &  other  ) 

Definition at line 682 of file zSelector.cpp.

00682                                                                                        :
00683         zSelector(other)
00684 { }

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

Definition at line 298 of file zSelector.h.

00298 {};


Member Function Documentation

zSelector * zSelectorSingleDeadOwner::create (  )  [static]

Reimplemented from zSelector.

Definition at line 673 of file zSelector.cpp.

References zSelectorSingleDeadOwner().

00674 {
00675     return new zSelectorSingleDeadOwner();
00676 }

Here is the call graph for this function:

void zSelectorSingleDeadOwner::operator= ( zSelectorSingleDeadOwner const &  other  ) 

overloaded assignment operator

Definition at line 686 of file zSelector.cpp.

References zSelector::operator=().

00687 {
00688     this->zSelector::operator=(other);
00689 }

Here is the call graph for this function:

zSelectorSingleDeadOwner * zSelectorSingleDeadOwner::copy ( void   )  const [virtual]

Reimplemented from zSelector.

Definition at line 691 of file zSelector.cpp.

References zSelectorSingleDeadOwner().

00692 {
00693     return new zSelectorSingleDeadOwner(*this);
00694 }

Here is the call graph for this function:

gVectorExtra< ePlayerNetID * > zSelectorSingleDeadOwner::select ( gVectorExtra< nNetObjectID > &  owners,
gVectorExtra< nNetObjectID > &  teamOwners,
gCycle triggerer 
) [virtual]

Reimplemented from zSelector.

Definition at line 696 of file zSelector.cpp.

References _dead, zSelector::getAllValid(), zSelector::pickOne(), and sn_netObjects.

00697 {
00698     // A single, randomly selected dead member of
00699     // the team of the player that triggered the Zone receives the
00700     // effect.
00701 
00702     gVectorExtra <ePlayerNetID *> owningPlayers;
00703     gVectorExtra <ePlayerNetID *> deadOwners;
00704     gVectorExtra <ePlayerNetID *> singleDeadOwner;
00705 
00706     // Transform the list of owners' id into a list of ePlayer
00707     for(gVectorExtra< nNetObjectID >::const_iterator iter=owners.begin();
00708             iter!=owners.end();
00709             ++iter) {
00710         // Is the object still there
00711         if(bool(sn_netObjects[(*iter)]))
00712         {
00713             ePlayerNetID * aPlayer = static_cast< ePlayerNetID* >( static_cast< nNetObject* >( sn_netObjects[ (*iter) ] ) ) ;
00714             if(aPlayer != 0)
00715                 owningPlayers.push_back( aPlayer );
00716         }
00717     }
00718 
00719     // Preserve only the dead players
00720     getAllValid(deadOwners, owningPlayers, _dead);
00721 
00722     // Who is our lucky candidate ?
00723     if(deadOwners.size() != 0)
00724         singleDeadOwner.push_back(pickOne(deadOwners));
00725 
00726     return singleDeadOwner;
00727 }

Here is the call graph for this function:


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