本文整理汇总了C++中PlayerList类的典型用法代码示例。如果您正苦于以下问题:C++ PlayerList类的具体用法?C++ PlayerList怎么用?C++ PlayerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PlayerList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _processIsmGroupLootMasterResponse
void GroupManager::_processIsmGroupLootMasterResponse(Message* message)
{
gLogger->logMsg("_processIsmGroupLootMasterResponse");
PlayerObject* playerObject = gWorldManager->getPlayerByAccId(message->getUint32()); // the player whos group_id has changed
if(playerObject == NULL)
{
gLogger->logMsg("GroupManager::_processIsmGroupLootMasterResponse PlayerAccId not found");
return;
}
//send the SUI
gLogger->logMsg("ok\n");
PlayerList inRangeMembers = playerObject->getInRangeGroupMembers(true);
PlayerList::iterator it = inRangeMembers.begin();
BStringVector namesArray;
while(it != inRangeMembers.end())
{
namesArray.push_back((*it)->getFirstName().getAnsi());
++it;
}
gUIManager->createNewPlayerSelectListBox(playerObject,"handleSetLootMaster","@group:master_looter_sui_title","@group:set_loot_type_text",namesArray,inRangeMembers,playerObject);
}
示例2: painter
void MyAvatarLabel::paintEvent(QPaintEvent*)
{
QPainter painter(this);
if(transparent)
painter.setOpacity(0.4);
else
painter.setOpacity(1.0);
//hide avatar if player is on ignore list
boost::shared_ptr<Game> currentGame = myW->myStartWindow->getSession()->getCurrentGame();
PlayerListConstIterator it_c;
int seatPlace;
PlayerList seatsList = currentGame->getSeatsList();
for (seatPlace=0,it_c=seatsList->begin(); it_c!=seatsList->end(); ++it_c, seatPlace++) {
if(seatPlace == myId) {
if(!playerIsOnIgnoreList(QString::fromUtf8((*it_c)->getMyName().c_str()))) {
painter.drawPixmap(0,0,myPixmap);
return;
}
else if(myW->getMyConfig()->readConfigInt("DontHideAvatarsOfIgnored")) {
painter.drawPixmap(0,0,myPixmap);
return;
}
}
}
}
示例3: set_descriptors
int set_descriptors()
{
FD_ZERO(&in_set);
FD_ZERO(&out_set);
int max_socket = ircSocket;
// We want IO from irc
FD_SET(ircSocket, &in_set);
if (!ircOutBuf.empty()) {
FD_SET(ircSocket, &out_set);
}
// And IO from players
for (PlayerListIterator i = playerList.begin(); i != playerList.end(); ++i) {
if ((*i)->socket != NO_SOCKET) {
max_socket = max ((*i)->socket, max_socket);
FD_SET((*i)->socket, &in_set);
if (!(*i)->out_buf.empty()) {
FD_SET((*i)->socket, &out_set);
}
}
}
return max_socket;
}
示例4: refreshTooltips
void MyAvatarLabel::refreshTooltips()
{
boost::shared_ptr<Game> currentGame = myW->myStartWindow->getSession()->getCurrentGame();
PlayerListConstIterator it_c;
int seatPlace;
PlayerList seatsList = currentGame->getSeatsList();
for (seatPlace=0,it_c=seatsList->begin(); it_c!=seatsList->end(); ++it_c, seatPlace++) {
if((*it_c)->getMyStayOnTableStatus() == TRUE || (*it_c)->getMyActiveStatus()) {
bool computerPlayer = false;
if((*it_c)->getMyType() == PLAYER_TYPE_COMPUTER) {
computerPlayer = true;
}
if(!computerPlayer && getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str()))!="" && seatPlace!=0) {
myW->playerTipLabelArray[(*it_c)->getMyID()]->setText(QString("<a style='text-decoration: none; color: #"+myW->getMyGameTableStyle()->getPlayerInfoHintTextColor()+"; font-size: 14px; font-weight: bold; font-family:serif;' href=\'")+QString::fromUtf8((*it_c)->getMyName().c_str())+"\'>i</a>");
myW->playerTipLabelArray[(*it_c)->getMyID()]->setToolTip( getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str())) );
myW->playerAvatarLabelArray[(*it_c)->getMyID()]->setToolTip( getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str())) );
} else {
myW->playerTipLabelArray[(*it_c)->getMyID()]->setText("");
myW->playerTipLabelArray[(*it_c)->getMyID()]->setToolTip("");
myW->playerAvatarLabelArray[(*it_c)->getMyID()]->setToolTip("");
}
} else {
myW->playerTipLabelArray[(*it_c)->getMyID()]->setText("");
myW->playerTipLabelArray[(*it_c)->getMyID()]->setToolTip("");
myW->playerAvatarLabelArray[(*it_c)->getMyID()]->setToolTip("");
}
}
refreshStars();
}
示例5: locker
void QBSoundWin::stopAll()
{
//printf("stopAll\n");
QBSoundLocker locker(&mMutex);
#ifdef __USE_OGG_VORBIS__
{
PlayerList::iterator it = streamTrack.begin();
while(it != streamTrack.end()) {
delete (*it).second;
++it;
}
streamTrack.clear();
}
{
EffectList::iterator it = sharedList().begin();
while(it != sharedList().end())
{
delete (*it).second;
++it;
}
sharedList().clear();
}
#endif
return QBSound::stopAll();
}
示例6: play
void Turn::play()
{
game->setState(TURN);
game->getDeck()->pick();
game->getCardsOnTable()[3] = game->getDeck()->pick();
game->setCardsOnTableCount(4);
PlayerList *playerList = game->getPlayerList();
playerList->setNextPlayer(1);
playersToPlay = playerList->getPlayersInGameCount();
game->setCurrentBet(0);
bool eos = false;
everyonePlayed = false;
currentPlayer = 0;
std::cout << "Turn" << std::endl;
while(!eos)
{
Player *player = playerList->getNext();
player->play();
playerPlayed();
eos = canEndState();
}
endOfState();
}
示例7: reportBadAvatar
void MyAvatarLabel::reportBadAvatar()
{
boost::shared_ptr<Game> currentGame = myW->getSession()->getCurrentGame();
int j=0;
PlayerListConstIterator it_c;
PlayerList seatList = currentGame->getSeatsList();
for (it_c=seatList->begin(); it_c!=seatList->end(); ++it_c) {
if(myId == j) {
QString avatar = QString::fromUtf8((*it_c)->getMyAvatar().c_str());
if(!avatar.isEmpty()) {
QString nick = QString::fromUtf8((*it_c)->getMyName().c_str());
int ret = MyMessageBox::question(this, tr("PokerTH - Question"),
tr("Are you sure you want to report the avatar of \"%1\" as inappropriate?").arg(nick), QMessageBox::Yes | QMessageBox::No);
if(ret == QMessageBox::Yes) {
QFileInfo fi(avatar);
myW->getSession()->reportBadAvatar((*it_c)->getMyUniqueID(), fi.baseName().toStdString());
}
}
break;
}
j++;
}
}
示例8: _sendToInstancedPlayersUnreliable
//======================================================================================================================
//
// Broadcasts a message to players in group and in range of the given object, used by tutorial and other instances
//
void MessageLib::_sendToInstancedPlayersUnreliable(Message* message,uint16 priority, const PlayerObject* const playerObject) const
{
if (!_checkPlayer(playerObject))
{
mMessageFactory->DestroyMessage(message);
return;
}
PlayerList const inRangeMembers = playerObject->getInRangeGroupMembers(true);
PlayerList::const_iterator playerIt = inRangeMembers.begin();
while (playerIt != inRangeMembers.end())
{
if (_checkPlayer(*playerIt))
{
// Clone the message.
mMessageFactory->StartMessage();
mMessageFactory->addData(message->getData(),message->getSize());
((*playerIt)->getClient())->SendChannelAUnreliable(mMessageFactory->EndMessage(),(*playerIt)->getAccountId(),CR_Client,static_cast<uint8>(priority));
}
++playerIt;
}
mMessageFactory->DestroyMessage(message);
}
示例9: PlayerList
void Mud::removeInactivePlayers()
{
PlayerList toRemove = PlayerList();
for (auto iterator : mudPlayers)
{
// Proceed only if the player is not connected and is closing.
if (!iterator->checkConnection() || iterator->closing)
{
// Add the player to the list of players that have to be removed.
toRemove.insert(iterator);
}
}
for (auto iterator = toRemove.begin(); iterator != toRemove.end(); ++iterator)
{
// Get the player at the given position.
Player * player = *iterator;
// Log the action of removing.
Logger::log(LogLevel::Global, "Removing inactive player : " + player->getName());
// Only if the player has successfully logged in, save its state on DB.
if (player->logged_in)
{
SQLiteDbms::instance().beginTransaction();
player->updateOnDB();
SQLiteDbms::instance().endTransaction();
}
// Remove the player from the list of players.
remPlayer(player);
// Delete the player.
delete (player);
}
}
示例10: players_process_lines
void players_process_lines()
{
for (PlayerListIterator i = playerList.begin(); i != playerList.end(); ++i) {
if ((*i)->socket != NO_SOCKET) {
player_process_lines((*i));
}
}
}
示例11: GetLocksList
bool LfgGroup::SelectRandomDungeon()
{
m_originalInfo = m_dungeonInfo;
m_lfgFlags |= LFG_GRP_RANDOM;
LfgLocksMap *groupLocks = GetLocksList();
std::vector<LFGDungeonEntry const*> options;
LFGDungeonEntry const *currentRow = NULL;
//Possible dungeons
LfgDungeonList* list = sLfgMgr.GetRandomOptions(m_dungeonInfo->ID);
for(LfgDungeonList::iterator itr = list->begin(); itr != list->end(); ++itr)
options.push_back(*itr);
//And now get only without locks
for(LfgLocksMap::iterator itr = groupLocks->begin(); itr != groupLocks->end(); ++itr)
{
for(LfgLocksList::iterator itr2 = itr->second->begin(); itr2 != itr->second->end(); ++itr2)
{
for(std::vector<LFGDungeonEntry const*>::iterator itrDung = options.begin(); itrDung != options.end(); ++itrDung)
{
if ((*itrDung)->ID != (*itr2)->dungeonInfo->ID)
continue;
DungeonInfo* dungeonInfo = sLfgMgr.GetDungeonInfo((*itr2)->dungeonInfo->ID);
if (dungeonInfo->locked || (*itr2)->lockType != LFG_LOCKSTATUS_RAID_LOCKED)
{
options.erase(itrDung);
break;
}
}
}
}
//This should not happen
if (options.empty())
{
PlayerList toRemove;
for(member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
{
Player *plr = sObjectMgr.GetPlayer(itr->guid);
if (!plr)
continue;
sLfgMgr.SendLfgUpdatePlayer(plr, LFG_UPDATETYPE_GROUP_DISBAND);
sLog.outError("LfgMgr: Cannot find any random dungeons for player %s", plr->GetName());
plr->GetSession()->SendNotification("Cannot find any random dungeons for this group, you have to find new group. We are sorry");
toRemove.insert(plr->GetGUID());
}
for(PlayerList::iterator itr = toRemove.begin(); itr != toRemove.end(); ++itr)
RemoveMember(*itr, 0);
toRemove.clear();
sLfgMgr.AddGroupToDelete(this);
return false;
}
//Select dungeon, there should be also bind check
uint32 tmp = time(NULL)%options.size();
m_dungeonInfo = options[tmp];
return true;
}
示例12: return
IrcPlayer *get_player_from_nick(string nick)
{
for (PlayerListIterator i = playerList.begin(); i != playerList.end(); ++i) {
if ((*i)->socket != NO_SOCKET) {
if (boost::iequals((*i)->nick, nick)) {
return (*i);
}
}
}
return NULL;
}
示例13: findPlayer
static QBStreamSound* findPlayer(int track)
{
QBStreamSound* player=NULL;
PlayerList::iterator p = streamTrack.find(track);
if (p != streamTrack.end()) {
player = p->second;
} else {
player = new QBStreamSound();
streamTrack.insert(make_pair(track,player));
}
return player;
}
示例14: CreatePlayerController
std::shared_ptr<PlayerController>
CreatePlayerController(int numPlayers)
{
const int numBills = 5;
PlayerList players;
for (int playerId = 0; playerId < numPlayers; ++playerId)
{
auto timer = std::make_unique<TimerObject>(playerId);
players.push_back(std::make_unique<Player>(playerId, std::move(timer), numBills));
}
return std::make_shared<PlayerController>(players);
}
示例15: updateMatchCells
/** calls updateMatchCell for each match cell ;)
*/
void RatingsTable::updateMatchCells( )
{
PlayerList players = _group->const_validPlayers();
int plCnt = players.count();
for ( int i = 1; i < rowCount(); i ++ ) {
for ( int j = 1; j < plCnt + 1; j ++ ) {
if ( i != j ) {
updateMatchCell( i, j );
}
}
}
}