#include <zSelector.h>
Public Member Functions | |
zSelectorOwnerTeamTeammate () | |
zSelectorOwnerTeamTeammate (zSelectorOwnerTeamTeammate const &other) | |
void | operator= (zSelectorOwnerTeamTeammate const &other) |
overloaded assignment operator | |
virtual zSelectorOwnerTeamTeammate * | copy (void) const |
virtual | ~zSelectorOwnerTeamTeammate () |
gVectorExtra< ePlayerNetID * > | select (gVectorExtra< nNetObjectID > &owners, gVectorExtra< nNetObjectID > &teamOwners, gCycle *triggerer) |
Static Public Member Functions | |
static zSelector * | create () |
Definition at line 239 of file zSelector.h.
zSelectorOwnerTeamTeammate::zSelectorOwnerTeamTeammate | ( | ) |
Definition at line 536 of file zSelector.cpp.
Referenced by copy(), and create().
00536 : 00537 zSelector() 00538 { }
zSelectorOwnerTeamTeammate::zSelectorOwnerTeamTeammate | ( | zSelectorOwnerTeamTeammate const & | other | ) |
virtual zSelectorOwnerTeamTeammate::~zSelectorOwnerTeamTeammate | ( | ) | [inline, virtual] |
zSelector * zSelectorOwnerTeamTeammate::create | ( | ) | [static] |
Reimplemented from zSelector.
Definition at line 531 of file zSelector.cpp.
References zSelectorOwnerTeamTeammate().
00532 { 00533 return new zSelectorOwnerTeamTeammate(); 00534 }
void zSelectorOwnerTeamTeammate::operator= | ( | zSelectorOwnerTeamTeammate const & | other | ) |
overloaded assignment operator
Definition at line 544 of file zSelector.cpp.
References zSelector::operator=().
00545 { 00546 this->zSelector::operator=(other); 00547 }
zSelectorOwnerTeamTeammate * zSelectorOwnerTeamTeammate::copy | ( | void | ) | const [virtual] |
Reimplemented from zSelector.
Definition at line 549 of file zSelector.cpp.
References zSelectorOwnerTeamTeammate().
00550 { 00551 return new zSelectorOwnerTeamTeammate(*this); 00552 }
gVectorExtra< ePlayerNetID * > zSelectorOwnerTeamTeammate::select | ( | gVectorExtra< nNetObjectID > & | owners, | |
gVectorExtra< nNetObjectID > & | teamOwners, | |||
gCycle * | triggerer | |||
) | [virtual] |
Reimplemented from zSelector.
Definition at line 554 of file zSelector.cpp.
References _alive, eTeam::GetAllMembers(), zSelector::getAllValid(), gVectorExtra< T >::insertAll(), zSelector::pickOne(), and sn_netObjects.
00555 { 00556 // Pick all the members of the teams 00557 gVectorExtra <ePlayerNetID *> allTeammates; 00558 gVectorExtra< nNetObjectID >::const_iterator iter; 00559 for(iter = teamOwners.begin(); 00560 iter != teamOwners.end(); 00561 ++iter) 00562 { 00563 // Is the object still there 00564 if(bool(sn_netObjects[(*iter)])) 00565 { 00566 eTeam * aTeam = static_cast< eTeam* >( static_cast< nNetObject* >( sn_netObjects[ (*iter) ] ) ) ; 00567 if(aTeam != 0) 00568 allTeammates.insertAll(aTeam->GetAllMembers()); 00569 } 00570 } 00571 00572 // Keep only the valid ones 00573 gVectorExtra <ePlayerNetID *> teammates; 00574 getAllValid(teammates, allTeammates, _alive); 00575 00576 // Select a random one 00577 gVectorExtra<ePlayerNetID *> singleTeammate; 00578 if(teammates.size() != 0) 00579 singleTeammate.push_back(pickOne(teammates)); 00580 return singleTeammate; 00581 }