Hello! I'm trying to modify opensourced application but due to lack of knowledge, I'm stuck. Explantions are in the comments of the app :-) Thanks in adavance for your support!
void CBaseGame :: FixSlots( )
{
struct Struct1{
list<string> UserList;
list<CGameSlot> PlayerSlots;
};
list<string>::iterator IT;
list<CGameSlot>::iterator TI;
for( vector<CGamePlayer *> :: iterator i = m_Players.begin( ); i != m_Players.end( ); i++ )
{
unsigned char PID = (*i)->GetPID( );
if( PID < 13 )
{
unsigned char SID = GetSIDFromPID( PID );
Struct1.UserList.push_back( (*i)->GetName( ) ); // let's say it added "Bob", "Mike", "Jack"
Struct1.PlayerSlots.push_back( SID ); // let's say it added "0, 1, 2"
}
}
list<Struct1> toSort; // merge ?
// Here I would like to sort this list by name SO UserList
// turns to "Bob", "Jack", "Mike" AND automaticly PlayerSlots to "0, 2, 1"
toSort.sort( );
// After this I would like to print them all like ["Bob -> 0", "Jack -> 2", "Mike -> 1"
// but I have completly no idea how to print from vector struct
}