当前位置: 首页>>代码示例>>C++>>正文


C++ HouseTile::creatures_begin方法代码示例

本文整理汇总了C++中HouseTile::creatures_begin方法的典型用法代码示例。如果您正苦于以下问题:C++ HouseTile::creatures_begin方法的具体用法?C++ HouseTile::creatures_begin怎么用?C++ HouseTile::creatures_begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HouseTile的用法示例。


在下文中一共展示了HouseTile::creatures_begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: cleanHouse

void House::cleanHouse()
{
  transferToDepot();

  PlayerVector to_kick;
  HouseTile* houseTile;
  for(HouseTileList::iterator it = houseTiles.begin(); it != houseTiles.end(); ++it){
    houseTile = (*it);
    for(CreatureConstIterator cit = houseTile->creatures_begin(); cit != houseTile->creatures_end(); ++cit){
      if((*cit)->getPlayer()){
        to_kick.push_back((*cit)->getPlayer());
      }
    }
  }
  while(!to_kick.empty()){
    Player* c = to_kick.back();
    to_kick.pop_back();
    kickPlayer(NULL, c->getName());
  }

  // we need to remove players from beds
  for(HouseBedItemList::iterator it = bedsList.begin(); it != bedsList.end(); ++it){
    if((*it)->getSleeper() != 0){
      (*it)->wakeUp();
    }
  }
}
开发者ID:OMARTINEZ210,项目名称:server,代码行数:27,代码来源:house.cpp

示例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;
  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);
    }
  }
}
开发者ID:OMARTINEZ210,项目名称:server,代码行数:44,代码来源:house.cpp


注:本文中的HouseTile::creatures_begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。