Пример #1
0
/** Receive and store the information from sendKartsInformation()
*/
void RaceManager::setupPlayerKartInfo()
{

    std::vector<RemoteKartInfo> kart_info;

    // Get the local kart info
    for(unsigned int i=0; i<getNumLocalPlayers(); i++)
        kart_info.push_back(getLocalKartInfo(i));

    // Now sort by (hostid, playerid)
    std::sort(kart_info.begin(), kart_info.end());

    // Set the player kart information
    setNumPlayers(kart_info.size());

    // Set the global player ID for each player
    for(unsigned int i=0; i<kart_info.size(); i++)
    {
        kart_info[i].setGlobalPlayerId(i);
        setPlayerKart(i, kart_info[i]);
    }

    computeRandomKartList();
}   // setupPlayerKartInfo
Пример #2
0
/** Fills up the remaining kart slots with AI karts.
 */
void RaceManager::setupPlayerKartInfo()
{
    computeRandomKartList();
}   // setupPlayerKartInfo