#include <zSelector.h>
Public Member Functions | |
zSelectorAnotherNotTeammateDead () | |
zSelectorAnotherNotTeammateDead (zSelectorAnotherNotTeammateDead const &other) | |
void | operator= (zSelectorAnotherNotTeammateDead const &other) |
overloaded assignment operator | |
virtual zSelectorAnotherNotTeammateDead * | copy (void) const |
virtual | ~zSelectorAnotherNotTeammateDead () |
gVectorExtra< ePlayerNetID * > | select (gVectorExtra< nNetObjectID > &owners, gVectorExtra< nNetObjectID > &teamOwners, gCycle *triggerer) |
Static Public Member Functions | |
static zSelector * | create () |
Definition at line 325 of file zSelector.h.
zSelectorAnotherNotTeammateDead::zSelectorAnotherNotTeammateDead | ( | ) |
Definition at line 789 of file zSelector.cpp.
Referenced by copy(), and create().
00789 : 00790 zSelector() 00791 { }
zSelectorAnotherNotTeammateDead::zSelectorAnotherNotTeammateDead | ( | zSelectorAnotherNotTeammateDead const & | other | ) |
virtual zSelectorAnotherNotTeammateDead::~zSelectorAnotherNotTeammateDead | ( | ) | [inline, virtual] |
zSelector * zSelectorAnotherNotTeammateDead::create | ( | ) | [static] |
Reimplemented from zSelector.
Definition at line 784 of file zSelector.cpp.
References zSelectorAnotherNotTeammateDead().
00785 { 00786 return new zSelectorAnotherNotTeammateDead(); 00787 }
void zSelectorAnotherNotTeammateDead::operator= | ( | zSelectorAnotherNotTeammateDead const & | other | ) |
overloaded assignment operator
Definition at line 797 of file zSelector.cpp.
References zSelector::operator=().
00798 { 00799 this->zSelector::operator=(other); 00800 }
zSelectorAnotherNotTeammateDead * zSelectorAnotherNotTeammateDead::copy | ( | void | ) | const [virtual] |
Reimplemented from zSelector.
Definition at line 802 of file zSelector.cpp.
References zSelectorAnotherNotTeammateDead().
00803 { 00804 return new zSelectorAnotherNotTeammateDead(*this); 00805 }
gVectorExtra< ePlayerNetID * > zSelectorAnotherNotTeammateDead::select | ( | gVectorExtra< nNetObjectID > & | owners, | |
gVectorExtra< nNetObjectID > & | teamOwners, | |||
gCycle * | triggerer | |||
) | [virtual] |
Reimplemented from zSelector.
Definition at line 807 of file zSelector.cpp.
References _dead, _either, ePlayerNetID::CurrentTeam(), eTeam::GetAllMembers(), zSelector::getAllValid(), GrowingArrayBase::Len(), zSelector::pickOne(), eNetGameObject::Player(), gVectorExtra< T >::removeAll(), and se_PlayerNetIDs.
00808 { 00809 // A single, randomly selected dead player receives the 00810 // effect. 00811 00812 // Get all the dead players 00813 gVectorExtra<ePlayerNetID *> everybody; 00814 for (int i=0; i<se_PlayerNetIDs.Len(); i++) { 00815 everybody.push_back( se_PlayerNetIDs(i) ); 00816 } 00817 gVectorExtra<ePlayerNetID *> everybodyDead; 00818 getAllValid(everybodyDead, everybody, _dead); 00819 00820 gVectorExtra <ePlayerNetID *> singleDeadNotTeammate; 00821 if (everybodyDead.size() != 0) 00822 { 00823 gVectorExtra <ePlayerNetID *> teammates; 00824 // Remove all the teammates 00825 ePlayerNetID* triggererPlayer = triggerer->Player(); 00826 if (triggererPlayer != 0) 00827 { 00828 getAllValid(teammates, triggererPlayer->CurrentTeam()->GetAllMembers(), _either); 00829 00830 // Remove the teammates 00831 everybodyDead.removeAll(teammates); 00832 00833 // Who is our lucky candidate ? 00834 if(everybodyDead.size() != 0) 00835 singleDeadNotTeammate.push_back(pickOne(everybodyDead)); 00836 } 00837 } 00838 return singleDeadNotTeammate; 00839 }