void ActorSet::moveObject(ActorSet &dest, OBJECT_ID id) { ASSERT(isMember(id), "The object is not a member of this set"); ASSERT(!dest.isMember(id), "The object is already a member of the other set"); // Add it to the other set dest.insert( make_pair(id, toActor(*find(id))) ); // Remove it from this set erase(find(id)); }
ActorSet ActorSet::haveMoved(void) const { ActorSet s; for(const_iterator i=begin(); i!=end(); ++i) { const Actor *p = i->second; if(!p->zombie && (p->hasAnimated || p->hasMoved)) { s.insert(*i); } } return s; }
ActorSet ActorSet::isNotWithin(const Frustum &frustum) const { ActorSet s; for(const_iterator i=begin(); i!=end(); ++i) { const Actor *p = i->second; if(!p->zombie && !frustum.SphereInFrustum2(p->getPos(), p->getSphereRadius()*2)) { s.insert(*i); } } return s; }