本文整理汇总了C++中Door::setAccessList方法的典型用法代码示例。如果您正苦于以下问题:C++ Door::setAccessList方法的具体用法?C++ Door::setAccessList怎么用?C++ Door::setAccessList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Door
的用法示例。
在下文中一共展示了Door::setAccessList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAccessList
void House::setAccessList(uint32_t listId, const std::string& textlist)
{
if (listId == GUEST_LIST) {
guestList.parseList(textlist);
} else if (listId == SUBOWNER_LIST) {
subOwnerList.parseList(textlist);
} else {
Door* door = getDoorByNumber(listId);
if (door) {
door->setAccessList(textlist);
}
// We dont have kick anyone
return;
}
//kick uninvited players
for (HouseTile* tile : houseTiles) {
if (CreatureVector* creatures = tile->getCreatures()) {
for (int32_t i = creatures->size(); --i >= 0;) {
Player* player = (*creatures)[i]->getPlayer();
if (player && !isInvited(player)) {
kickPlayer(nullptr, player);
}
}
}
}
}
示例2: setAccessList
void House::setAccessList(uint32_t listId, const std::string& textlist)
{
if(listId == GUEST_LIST)
guestList.parseList(textlist);
else if(listId == SUBOWNER_LIST)
subOwnerList.parseList(textlist);
else
{
Door* door = getDoorByNumber(listId);
if(door)
door->setAccessList(textlist);
else
{
#ifdef __DEBUG_HOUSES__
std::cout << "Failure: [House::setAccessList] door == NULL, listId = " << listId <<std::endl;
#endif
}
//We dont have kick anyone
return;
}
//kick uninvited players
typedef std::list<Player*> KickPlayerList;
KickPlayerList kickList;
HouseTileList::iterator it;
for(it = houseTiles.begin(); it != houseTiles.end(); ++it)
{
HouseTile* hTile = *it;
if(CreatureVector* creatures = hTile->getCreatures())
{
CreatureVector::iterator cit;
for(cit = creatures->begin(); cit != creatures->end(); ++cit)
{
Player* player = (*cit)->getPlayer();
if(player && isInvited(player) == false)
kickList.push_back(player);
}
}
}
KickPlayerList::iterator itkick;
for(itkick = kickList.begin(); itkick != kickList.end(); ++itkick)
{
if(g_game.internalTeleport(*itkick, getEntryPosition()) == RET_NOERROR)
g_game.addMagicEffect(getEntryPosition(), NM_ME_TELEPORT);
}
}
示例3: setAccessList
void House::setAccessList(uint32_t listId, const std::string& textlist)
{
if(listId == GUEST_LIST){
guestList.parseList(textlist);
}
else if(listId == SUBOWNER_LIST){
subOwnerList.parseList(textlist);
}
else{
Door* door = getDoorByNumber(listId);
if(door){
door->setAccessList(textlist);
}
else{
#ifdef __DEBUG_HOUSES__
std::cout << "Failure: [House::setAccessList] door == NULL, listId = " << listId <<std::endl;
#endif
}
//We dont have kick anyone
return;
}
//kick uninvited players
typedef std::list<Player*> KickPlayerList;
KickPlayerList kickList;
HouseTileList::iterator it;
HouseTile* houseTile;
for(it = houseTiles.begin(); it != houseTiles.end(); ++it){
houseTile = (*it);
for(CreatureIterator cit = houseTile->creatures_begin(); cit != houseTile->creatures_end(); ++cit){
Player* player = (*cit)->getPlayer();
if(player && isInvited(player) == false){
kickList.push_back(player);
}
}
}
KickPlayerList::iterator itkick;
for(itkick = kickList.begin(); itkick != kickList.end(); ++itkick){
if(g_game.internalTeleport(NULL, *itkick, getEntryPosition()) == RET_NOERROR){
g_game.addMagicEffect(getEntryPosition(), MAGIC_EFFECT_BLUE_BUBBLE);
}
}
}