本文整理汇总了C++中ObjectList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectList::end方法的具体用法?C++ ObjectList::end怎么用?C++ ObjectList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectList
的用法示例。
在下文中一共展示了ObjectList::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fill_guard_tasks_basic
void fill_guard_tasks_basic(Statement stmt)
{
struct IsOmpTask : public Predicate<AST_t>
{
ScopeLink _sl;
IsOmpTask(ScopeLink sl)
:_sl(sl)
{
}
bool do_(IsOmpTask::ArgType a) const
{
return is_pragma_custom_construct("omp", "task", a, _sl);
}
};
ObjectList<AST_t> tasks = stmt.get_ast().depth_subtrees(IsOmpTask(stmt.get_scope_link()));
for (ObjectList<AST_t>::iterator it = tasks.begin();
it != tasks.end();
it++)
{
PragmaCustomConstruct task_construct(*it, stmt.get_scope_link());
GuardedTask guarded_task(task_construct);
_guarded_task_list.append(guarded_task);
_num_tasks++;
}
}
示例2: GroupObjects
void CGroupObject::GroupObjects(ObjectList& lst)
{
R_ASSERT(lst.size());
for (ObjectIt it=lst.begin(); it!=lst.end(); it++)
LL_AppendObject(*it,true);
UpdatePivot(0,false);
}
示例3: isContainerEmpty
bool Tutorial::isContainerEmpty(uint64 containerId)
{
bool empty = false;
if (containerId == mContainerEventId)
{
Container* container = dynamic_cast<Container*>(gWorldManager->getObjectById(containerId));
if (container)
{
uint32 objectCount = 0;
ObjectList* objList = container->getObjects();
ObjectList::iterator it = objList->begin();
ObjectList::iterator cEnd = objList->end();
while(it != cEnd)
{
if((*it)->getPrivateOwner() == this->getPlayer())
++objectCount;
++it;
}
empty = (objectCount == 0);
}
}
return empty;
}
示例4: removeStructureItemsForPlayer
//=========================================================================================
//
// removes all structures items for a player
// call this when destroying a building
//
void SpatialIndexManager::removeStructureItemsForPlayer(PlayerObject* player, BuildingObject* building)
{
DLOG(info) << "SpatialIndexManager::removeStructureItemsForPlayer:: : " << player->getId();
ObjectList cellObjects = building->getAllCellChilds();
ObjectList::iterator objIt = cellObjects.begin();
while(objIt != cellObjects.end()) {
Object* object = (*objIt);
if(PlayerObject* otherPlayer = dynamic_cast<PlayerObject*>(object)) {
//do nothing players and creatures are always in the grid
}
else if(CreatureObject* pet = dynamic_cast<CreatureObject*>(object)) {
//do nothing players and creatures are always in the grid
}
else {
if((object) && (object->checkRegisteredWatchers(player))) {
gContainerManager->unRegisterPlayerFromContainer(object,player);
gMessageLib->sendDestroyObject(object->getId(), player);
}
}
objIt++;
}
}
示例5: initObjectsInRange
void SpatialIndexManager::initObjectsInRange(PlayerObject* player) {
uint64_t player_id = player->getParentId();
if (player_id == 0) {
return;
}
Object* tmp = gWorldManager->getObjectById(player_id);
if (tmp->getType() != ObjType_Cell) {
return;
}
CellObject* cell = static_cast<CellObject*>(tmp);
tmp = gWorldManager->getObjectById(cell->getParentId());
if (tmp->getType() != ObjType_Building) {
return;
}
BuildingObject* building = static_cast<BuildingObject*>(tmp);
ObjectList children = building->getAllCellChilds();
std::for_each(children.begin(), children.end(), [this, player] (Object* cell_child) {
if (cell_child->getType() != ObjType_Tangible) {
return;
}
sendCreateObject(cell_child, player, true);
});
}
示例6: MultiSelByRefObject
void __fastcall TfraGroup::MultiSelByRefObject ( bool clear_prev )
{
ObjectList objlist;
LPU32Vec sellist;
if (Scene->GetQueryObjects(objlist,OBJCLASS_GROUP,1,1,-1)){
for (ObjectIt it=objlist.begin(); it!=objlist.end(); it++){
LPCSTR N = ((CGroupObject*)*it)->RefName();
ObjectIt _F = Scene->FirstObj(OBJCLASS_GROUP);
ObjectIt _E = Scene->LastObj(OBJCLASS_GROUP);
for(;_F!=_E;_F++){
CGroupObject *_O = (CGroupObject *)(*_F);
if((*_F)->Visible()&&_O->RefCompare(N)){
if (clear_prev){
_O->Select( false );
sellist.push_back((u32*)_O);
}else{
if (!_O->Selected())
sellist.push_back((u32*)_O);
}
}
}
}
std::sort (sellist.begin(),sellist.end());
sellist.erase (std::unique(sellist.begin(),sellist.end()),sellist.end());
std::random_shuffle (sellist.begin(),sellist.end());
int max_k = iFloor(float(sellist.size())/100.f*float(seSelPercent->Value)+0.5f);
int k = 0;
for (LPU32It o_it=sellist.begin(); k<max_k; o_it++,k++){
CGroupObject *_O = (CGroupObject *)(*o_it);
_O->Select( true );
}
}
}
示例7: propagate_argument_rec
void propagate_argument_rec( Node* current, RenameVisitor* v )
{
if( !current->is_visited( ) )
{
current->set_visited( true );
if( current->is_entry_node( ) || current->is_exit_node( ) )
return;
if( current->is_graph_node( ) )
{
propagate_argument_rec( current->get_graph_entry_node( ), v );
}
else
{
ObjectList<Nodecl::NodeclBase> stmts = current->get_statements( );
ObjectList<Nodecl::NodeclBase> new_stmts;
for( ObjectList<Nodecl::NodeclBase>::iterator it = stmts.begin( ); it != stmts.end( ); ++it )
{
Nodecl::NodeclBase it_copy = Nodecl::Utils::deep_copy( *it, *it );
v->walk( *it );
new_stmts.insert( it_copy );
}
current->set_statements( new_stmts );
}
ObjectList<Node*> children = current->get_children( );
for( ObjectList<Node*>::iterator it = children.begin( ); it != children.end( ); ++it )
{
propagate_argument_rec( *it, v );
}
}
}
示例8: UngroupObjects
void ESceneGroupTool::UngroupObjects(bool bUndo)
{
ObjectList lst = m_Objects;
int sel_cnt = 0;
if (!lst.empty())
{
bool bModif = false;
for (ObjectIt it=lst.begin(); it!=lst.end(); ++it)
{
if ((*it)->Selected())
{
sel_cnt++;
CGroupObject* obj = dynamic_cast<CGroupObject*>(*it);
VERIFY(obj);
if (obj->CanUngroup(true))
{
obj->UngroupObjects ();
Scene->RemoveObject (obj,false,true);
xr_delete (obj);
bModif = true;
}else
ELog.DlgMsg (mtError,"Can't ungroup object: '%s'.",obj->Name);
}
}
if (bUndo&&bModif)
Scene->UndoSave();
}
if (0==sel_cnt)
ELog.Msg (mtError,"Nothing selected.");
}
示例9: IsEscortInvokerInRange
bool SmartAI::IsEscortInvokerInRange()
{
ObjectList* targets = GetScript()->GetTargetList(SMART_ESCORT_TARGETS);
if (targets)
{
if (targets->size() == 1 && GetScript()->IsPlayer((*targets->begin())))
{
Player* player = (*targets->begin())->ToPlayer();
if (me->GetDistance(player) <= SMART_ESCORT_MAX_PLAYER_DIST)
return true;
if (Group* group = player->GetGroup())
{
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
{
Player* groupGuy = groupRef->getSource();
if (me->GetDistance(groupGuy) <= SMART_ESCORT_MAX_PLAYER_DIST)
return true;
}
}
}else
{
for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter)
{
if (GetScript()->IsPlayer((*iter)))
{
if (me->GetDistance((*iter)->ToPlayer()) <= SMART_ESCORT_MAX_PLAYER_DIST)
return true;
}
}
}
}
return true;//escort targets were not set, ignore range check
}
示例10: dtSelectObject
void dtSelectObject(DtObjectRef object) {
ObjectList::iterator i = objectList.find(object);
if (i != objectList.end()) {
move();
currentObject = (*i).second;
}
}
示例11: Update
void World::Update(const ObjectList& objList)
{
// Works each bodies' physics
for (auto it1 = objList.begin(); it1 != objList.end(); ++it1)
{
// 1. If sprite has body and activated body to work.
if (it1->second->HasRigidBody() &&
it1->second->GetRigidBody()->GetMoveToggle())
{
// Work basic motion
BodyPipeline(it1->second);
// 2. if 2st sprite's colliders to be worked, check colliders
if (it1->second->GetRigidBody()->GetColliderToggle())
{
// Refresh collision-with info
it1->second->GetRigidBody()->CheckCollided(false);
it1->second->GetRigidBody()->SetCollisionWith(nullptr);
auto new_begin = it1;
for (auto it2 = new_begin; it2 != objList.end(); ++it2)
{
// 3. If both objs are differenct and both bodies has own body,
// activated body and collider body,
if (it1 != it2 && it2->second->HasRigidBody() &&
it2->second->GetRigidBody()->GetColliderToggle())
{
// 4. then check the colliders.
// Check two sprites' collision status
bool collisionIntersect = CollisionIntersect(it1->second, it2->second);
if (collisionIntersect)
{
// Collision response
if (it1->second->GetRigidBody()->GetResponseToggle() ||
it2->second->GetRigidBody()->GetResponseToggle())
CollisionResponse(it1->second, it2->second);
// Refresh the collision with info
CollisionRelation(it1->second, it2->second);
}// 4. Check the colliders
}// 3. Has Rigid Body, 2 toggles to work
}
}// 2. Collider Toggle
}// 1. Body Toggle
}
}
示例12: RunSectorEventThread
void SectorManager::RunSectorEventThread()
{
m_SectorThreadRunning = true;
unsigned long current_tick;
long sleep_time;
unsigned long check_tick = m_SectorID;
ObjectList stations;
ObjectList::iterator itrOList;
if (m_ObjectMgr == (0)) return;
ObjectList * mob_list;
long mob_index = 0;
//TODO: don't need an object manager for stations, but we do need an event thread.
if (m_SectorID < 9999)
{
mob_list = m_ObjectMgr->GetMOBList();
m_ObjectMgr->SectorSetup(stations);
m_ObjectMgr->SetSectorManager(this);
}
do
{
current_tick = GetNet7TickCount();
if (m_SectorID < 9999) //only MOBs and object effects for space & planet sectors
{
ProcessMOBs(current_tick, check_tick, true);
//send station broadcasts
for (itrOList = stations.begin(); itrOList != stations.end(); ++itrOList)
{
(*itrOList)->SendSoundBroadcast(check_tick);
}
}
if (m_PlayerCount > 0) //only need to process timeslots if there are players present (for now - interacting MOBs will require time slots)
{
//first make the event calls for this node
CallSlotEvents(m_EventSlotIndex);
CallLongTermEvents(m_EventSlotIndex);
//increment the slot index
m_EventSlotIndex++;
if (m_EventSlotIndex == (TIMESLOT_DURATION*10)) m_EventSlotIndex = 0;
}
check_tick++;
sleep_time = current_tick - GetNet7TickCount() + SECTOR_THREAD_INTERVAL;
if (check_tick > 128) check_tick = 0;
if (sleep_time < 0) sleep_time = 0;
Sleep(sleep_time);
} while (!g_ServerShutdown);
m_SectorThreadRunning = false;
}
示例13: excludeByType
void excludeByType( ObjectList& list, const Set& set )
{
for( auto it=list.begin(); it != list.end(); )
{
if( set.count( (*it)->type() ) > 0 ) { it=list.erase( it ); }
else { ++it; }
}
}
示例14: dtProceed
void dtProceed() {
for (ComplexList::iterator i = complexList.begin();
i != complexList.end(); ++i)
(*i)->proceed();
for (ObjectList::const_iterator j = objectList.begin();
j != objectList.end(); ++j)
(*j).second->proceed();
}
示例15: EndPath
void SmartAI::EndPath(bool fail)
{
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, NULL, mLastWP->id, GetScript()->GetPathId());
RemoveEscortState(SMART_ESCORT_ESCORTING | SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING);
mWayPoints = NULL;
mCurrentWPID = 0;
mWPPauseTimer = 0;
mLastWP = NULL;
if (mCanRepeatPath)
StartPath(mRun, GetScript()->GetPathId(), mCanRepeatPath);
else
GetScript()->SetPathId(0);
ObjectList* targets = GetScript()->GetTargetList(SMART_ESCORT_TARGETS);
if (targets && mEscortQuestID)
{
if (targets->size() == 1 && GetScript()->IsPlayer((*targets->begin())))
{
Player* plr = (*targets->begin())->ToPlayer();
if(!fail && plr->IsAtGroupRewardDistance(me) && !plr->GetCorpse())
plr->GroupEventHappens(mEscortQuestID, me);
if(fail && plr->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
plr->FailQuest(mEscortQuestID);
if (Group *pGroup = plr->GetGroup())
{
for (GroupReference *gr = pGroup->GetFirstMember(); gr != NULL; gr = gr->next())
{
Player *pGroupGuy = gr->getSource();
if(!fail && pGroupGuy->IsAtGroupRewardDistance(me) && !pGroupGuy->GetCorpse())
pGroupGuy->AreaExploredOrEventHappens(mEscortQuestID);
if(fail && pGroupGuy->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
pGroupGuy->FailQuest(mEscortQuestID);
}
}
}else
{
for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); iter++)
{
if (GetScript()->IsPlayer((*iter)))
{
Player* plr = (*iter)->ToPlayer();
if(!fail && plr->IsAtGroupRewardDistance(me) && !plr->GetCorpse())
plr->AreaExploredOrEventHappens(mEscortQuestID);
if(fail && plr->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
plr->FailQuest(mEscortQuestID);
}
}
}
}
if (mDespawnState == 1)
StartDespawn();
}