本文整理汇总了C++中SortedVector::removeAll方法的典型用法代码示例。如果您正苦于以下问题:C++ SortedVector::removeAll方法的具体用法?C++ SortedVector::removeAll怎么用?C++ SortedVector::removeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortedVector
的用法示例。
在下文中一共展示了SortedVector::removeAll方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadPerformanceLocations
void PlanetManagerImplementation::loadPerformanceLocations() {
info("loading performance locations...", true);
SortedVector<ManagedReference<SceneObject*> > planetaryLocs;
planetaryLocs.setNoDuplicateInsertPlan();
// get hotels
planetaryLocs = zone->getPlanetaryObjectList("hotel");
for (int j = 0; j < planetaryLocs.size(); j++) {
SceneObject* obj = planetaryLocs.get(j);
addPerformanceLocation(obj);
}
// get theaters
planetaryLocs = zone->getPlanetaryObjectList("guild_theater");
for (int j = 0; j < planetaryLocs.size(); j++) {
SceneObject* obj = planetaryLocs.get(j);
addPerformanceLocation(obj);
}
// get cantinas
planetaryLocs.removeAll();
planetaryLocs = zone->getPlanetaryObjectList("cantina");
for (int j = 0; j < planetaryLocs.size(); j++) {
SceneObject* obj = planetaryLocs.get(j);
addPerformanceLocation(obj);
}
}
示例2: revokeAllPermissions
void StructurePermissionList::revokeAllPermissions() {
Locker locker(&lock);
for (int i = 0; i < idPermissionLists.size(); ++i) {
SortedVector<uint64>* list = &idPermissionLists.get(i);
list->removeAll();
if (idPermissionLists.elementAt(i).getKey() == "ADMIN") {
list->put(ownerID);
}
}
}
示例3: broadcastDestroyPrivate
void SceneObjectImplementation::broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject) {
ZoneServer* zoneServer = getZoneServer();
if (zoneServer != NULL && zoneServer->isServerLoading())
return;
if (parent.get() != NULL) {
ManagedReference<SceneObject*> grandParent = getRootParent().get();
if (grandParent != NULL) {
grandParent->broadcastDestroyPrivate(object, selfObject);
return;
} else {
return;
}
}
if (zone == NULL)
return;
SortedVector<ManagedReference<QuadTreeEntry*> > closeSceneObjects;
int maxInRangeObjectCount = 0;
if (closeobjects == NULL) {
info("Null closeobjects vector in SceneObjectImplementation::broadcastDestroyPrivate", true);
zone->getInRangeObjects(getPositionX(), getPositionY(), 256, &closeSceneObjects, true);
maxInRangeObjectCount = closeSceneObjects.size();
} else {
CloseObjectsVector* vec = (CloseObjectsVector*) closeobjects;
closeSceneObjects.removeAll(vec->size(), 10);
vec->safeCopyTo(closeSceneObjects);
maxInRangeObjectCount = closeSceneObjects.size();
}
for (int i = 0; i < maxInRangeObjectCount; ++i) {
SceneObject* scno = static_cast<SceneObject*>(closeSceneObjects.get(i).get());
ManagedReference<ZoneClientSession*> client = scno->getClient();
if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
object->sendDestroyTo(scno);
}
}
}
示例4: broadcastMessagesPrivate
void SceneObjectImplementation::broadcastMessagesPrivate(Vector<BasePacket*>* messages, SceneObject* selfObject) {
ZoneServer* zoneServer = getZoneServer();
if (zoneServer != NULL && zoneServer->isServerLoading())
return;
if (parent.get() != NULL) {
ManagedReference<SceneObject*> grandParent = cast<SceneObject*>(getRootParent().get().get());
if (grandParent != NULL) {
grandParent->broadcastMessagesPrivate(messages, selfObject);
return;
} else {
while (!messages->isEmpty()) {
delete messages->remove(0);
}
return;
}
}
if (zone == NULL) {
while (!messages->isEmpty()) {
delete messages->remove(0);
}
return;
}
//getZone()->rlock();
//Locker zoneLocker(zone);
bool readlock = !zone->isLockedByCurrentThread();
SortedVector<ManagedReference<QuadTreeEntry*> > closeSceneObjects;
int maxInRangeObjectCount = 0;
// zone->rlock(readlock);
try {
if (closeobjects == NULL) {
info(String::valueOf(getObjectID()) + " Null closeobjects vector in SceneObjectImplementation::broadcastMessagesPrivate", true);
zone->getInRangeObjects(getPositionX(), getPositionY(), 192, &closeSceneObjects, true);
maxInRangeObjectCount = closeSceneObjects.size();
} else {
maxInRangeObjectCount = closeobjects->size();
closeSceneObjects.removeAll(maxInRangeObjectCount, 10);
//closeSceneObjects.addAll(*closeobjects);
closeobjects->safeCopyTo(closeSceneObjects);
maxInRangeObjectCount = closeSceneObjects.size();
}
} catch (Exception& e) {
}
//getZone()->runlock();
//zoneLocker.release();
// zone->runlock(readlock);
for (int i = 0; i < maxInRangeObjectCount; ++i) {
SceneObject* scno = cast<SceneObject*>(closeSceneObjects.get(i).get());
if (selfObject == scno)
continue;
ManagedReference<ZoneClientSession*> client = scno->getClient();
if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
for (int j = 0; j < messages->size(); ++j) {
BasePacket* msg = messages->get(j);
scno->sendMessage(msg->clone());
}
}
}
while (!messages->isEmpty()) {
delete messages->remove(0);
}
}
示例5: broadcastDestroyPrivate
void SceneObjectImplementation::broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject) {
ZoneServer* zoneServer = getZoneServer();
if (zoneServer != NULL && zoneServer->isServerLoading())
return;
if (parent.get() != NULL) {
ManagedReference<SceneObject*> grandParent = cast<SceneObject*>(getRootParent().get().get());
if (grandParent != NULL) {
grandParent->broadcastDestroyPrivate(object, selfObject);
return;
} else {
return;
}
}
if (zone == NULL)
return;
//Locker zoneLocker(zone);
// bool readlock = !zone->isLockedByCurrentThread();
SortedVector<ManagedReference<QuadTreeEntry*> > closeSceneObjects;
int maxInRangeObjectCount = 0;
// zone->rlock(readlock);
try {
if (closeobjects == NULL) {
info("Null closeobjects vector in SceneObjectImplementation::broadcastDestroyPrivate", true);
zone->getInRangeObjects(getPositionX(), getPositionY(), 256, &closeSceneObjects, true);
maxInRangeObjectCount = closeSceneObjects.size();
} else {
CloseObjectsVector* vec = (CloseObjectsVector*) closeobjects;
closeSceneObjects.removeAll(vec->size(), 10);
// closeSceneObjects.addAll(*closeobjects);
vec->safeCopyTo(closeSceneObjects);
maxInRangeObjectCount = closeSceneObjects.size();//closeobjects->size();
}
} catch (...) {
//zone->runlock(readlock);
throw;
}
// zone->runlock(readlock);
for (int i = 0; i < maxInRangeObjectCount; ++i) {
SceneObject* scno = cast<SceneObject*>(closeSceneObjects.get(i).get());
if (selfObject == scno)
continue;
ManagedReference<ZoneClientSession*> client = scno->getClient();
if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
object->sendDestroyTo(scno);
}
}
}