本文整理汇总了C++中HouseTile::getCreatures方法的典型用法代码示例。如果您正苦于以下问题:C++ HouseTile::getCreatures方法的具体用法?C++ HouseTile::getCreatures怎么用?C++ HouseTile::getCreatures使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HouseTile
的用法示例。
在下文中一共展示了HouseTile::getCreatures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
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);
}
}