GetTosserArray
A gem of code written by my brother, just rediscovered in my email archives:
A function that calculates the world’s biggest tosser that makes the assumption that ‘person’ is the biggest tosser but compares her to all other tossers in case one happens to be more of a tosser. If they are tied for tosserishness, ‘Person’ will still be deemed the world’s biggest tosser.
Hope this helps and is bug-free.
CTosser* CTosserUtils::GetWorldsBiggestTosser()
{
CArray arTossers = m_LoserFactory.GetTosserArray();
CTosser* pPerson = m_LoserFactory.GetBigTosser();
CTosser* pWorldsBiggestTosser = pPerson;
int iNumTossersWorld = m_LoserFactory.GetSize();
for ( int i=0; i
{
CTosser* pTempTosser = arTossers.GetAt( i );
if ( pTempTosser->GetTosserishness() > pPerson->GetTosserishness() )
{
pWorldsBiggestTosser = pTempTosser;
}
}
return pWorldsBiggestTosser;
}

