#include <zSelector.h>
Public Member Functions | |
zSelectorSingleDeadOwner () | |
zSelectorSingleDeadOwner (zSelectorSingleDeadOwner const &other) | |
void | operator= (zSelectorSingleDeadOwner const &other) |
overloaded assignment operator | |
virtual zSelectorSingleDeadOwner * | copy (void) const |
virtual | ~zSelectorSingleDeadOwner () |
gVectorExtra< ePlayerNetID * > | select (gVectorExtra< nNetObjectID > &owners, gVectorExtra< nNetObjectID > &teamOwners, gCycle *triggerer) |
Static Public Member Functions | |
static zSelector * | create () |
Definition at line 290 of file zSelector.h.
zSelectorSingleDeadOwner::zSelectorSingleDeadOwner | ( | ) |
Definition at line 678 of file zSelector.cpp.
Referenced by copy(), and create().
00678 : 00679 zSelector() 00680 { }
zSelectorSingleDeadOwner::zSelectorSingleDeadOwner | ( | zSelectorSingleDeadOwner const & | other | ) |
virtual zSelectorSingleDeadOwner::~zSelectorSingleDeadOwner | ( | ) | [inline, virtual] |
zSelector * zSelectorSingleDeadOwner::create | ( | ) | [static] |
Reimplemented from zSelector.
Definition at line 673 of file zSelector.cpp.
References zSelectorSingleDeadOwner().
00674 { 00675 return new zSelectorSingleDeadOwner(); 00676 }
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 }
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 }
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 }