#include <zSelector.h>
Public Member Functions | |
zSelectorTeammate () | |
zSelectorTeammate (zSelectorTeammate const &other) | |
void | operator= (zSelectorTeammate const &other) |
overloaded assignment operator | |
virtual zSelectorTeammate * | copy (void) const |
virtual | ~zSelectorTeammate () |
gVectorExtra< ePlayerNetID * > | select (gVectorExtra< nNetObjectID > &owners, gVectorExtra< nNetObjectID > &teamOwners, gCycle *triggerer) |
Static Public Member Functions | |
static zSelector * | create () |
Definition at line 98 of file zSelector.h.
zSelectorTeammate::zSelectorTeammate | ( | ) |
Definition at line 150 of file zSelector.cpp.
Referenced by copy(), and create().
00150 : 00151 zSelector() 00152 { }
zSelectorTeammate::zSelectorTeammate | ( | zSelectorTeammate const & | other | ) |
virtual zSelectorTeammate::~zSelectorTeammate | ( | ) | [inline, virtual] |
zSelector * zSelectorTeammate::create | ( | ) | [static] |
Reimplemented from zSelector.
Definition at line 145 of file zSelector.cpp.
References zSelectorTeammate().
00146 { 00147 return new zSelectorTeammate(); 00148 }
void zSelectorTeammate::operator= | ( | zSelectorTeammate const & | other | ) |
overloaded assignment operator
Definition at line 158 of file zSelector.cpp.
References zSelector::operator=().
00159 { 00160 this->zSelector::operator=(other); 00161 }
zSelectorTeammate * zSelectorTeammate::copy | ( | void | ) | const [virtual] |
Reimplemented from zSelector.
Definition at line 163 of file zSelector.cpp.
References zSelectorTeammate().
00164 { 00165 return new zSelectorTeammate(*this); 00166 }
gVectorExtra< ePlayerNetID * > zSelectorTeammate::select | ( | gVectorExtra< nNetObjectID > & | owners, | |
gVectorExtra< nNetObjectID > & | teamOwners, | |||
gCycle * | triggerer | |||
) | [virtual] |
Reimplemented from zSelector.
Definition at line 168 of file zSelector.cpp.
References _alive, ePlayerNetID::CurrentTeam(), eTeam::GetAllMembers(), zSelector::getAllValid(), zSelector::pickOne(), eNetGameObject::Player(), and gVectorExtra< T >::remove().
00169 { 00170 // A single, randomly selected player that is member of the team of 00171 // the player that triggered the Zone receives the effect. This 00172 // includes the player that triggered the Zone as a candidate. 00173 gVectorExtra <ePlayerNetID *> teammates; 00174 gVectorExtra <ePlayerNetID *> singleTeammate; 00175 00176 ePlayerNetID* triggererPlayer = triggerer->Player(); 00177 if (triggererPlayer != 0) { 00178 getAllValid(teammates, triggererPlayer->CurrentTeam()->GetAllMembers(), _alive); 00179 00180 // Remove the triggerer if it is there 00181 teammates.remove(triggererPlayer); 00182 00183 // Who is our lucky candidate ? 00184 if(teammates.size() != 0) 00185 singleTeammate.push_back(pickOne(teammates)); 00186 } 00187 return singleTeammate; 00188 }