本文整理汇总了C++中PlayerList::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerList::erase方法的具体用法?C++ PlayerList::erase怎么用?C++ PlayerList::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerList
的用法示例。
在下文中一共展示了PlayerList::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remove_disconnected_players
void remove_disconnected_players()
{
PlayerListIterator i = playerList.begin ();
while (i != playerList.end ()) {
IrcPlayer *player = (*i);
PlayerListIterator prev = i;
i++;
if (player->socket == NO_SOCKET) {
say_to(player->nick, "You are now disconnected from uMUD");
playerList.erase(prev);
delete player;
player = 0;
}
} /* end of looping through players */
}
示例2: fill_sound_buffer
int QBSoundWin::fill_sound_buffer(void* buffer,int size)
{
QBSoundLocker locker(&mMutex);
int r = QBSound::fill_sound_buffer(buffer,size);
#ifdef __USE_OGG_VORBIS__
PlayerList::iterator it = streamTrack.begin();
while(it != streamTrack.end()) {
if ((*it).second->streamdone && (*it).first > 0) {
delete (*it).second;
streamTrack.erase(it++);
} else {
(*it).second->fill_sound_buffer(buffer,size,mMasterVolume);
++it;
}
}
#endif
return r;
}