本文整理汇总了C++中SortedVector::setNoDuplicateInsertPlan方法的典型用法代码示例。如果您正苦于以下问题:C++ SortedVector::setNoDuplicateInsertPlan方法的具体用法?C++ SortedVector::setNoDuplicateInsertPlan怎么用?C++ SortedVector::setNoDuplicateInsertPlan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortedVector
的用法示例。
在下文中一共展示了SortedVector::setNoDuplicateInsertPlan方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
SortedVector<ManagedReference<SceneObject*> > ZoneImplementation::getPlanetaryObjectList(const String& mapObjectLocationType) {
SortedVector<ManagedReference<SceneObject*> > retVector;
retVector.setNoDuplicateInsertPlan();
#ifndef WITH_STM
mapLocations->rlock();
#endif
try {
SortedVector<MapLocationEntry>& entryVector = mapLocations->getLocation(mapObjectLocationType);
for (int i = 0; i < entryVector.size(); ++i) {
MapLocationEntry entry = entryVector.get(i);
retVector.put(entry.getObject());
}
} catch (...) {
}
#ifndef WITH_STM
mapLocations->runlock();
#endif
return retVector;
}
示例2: 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);
}
}
示例3: getParent
ManagedWeakReference<SceneObject*> SceneObjectImplementation::getRootParent() {
ManagedReference<SceneObject*> grandParent = getParent();
ManagedReference<SceneObject*> tempParent = NULL;
if (grandParent == NULL)
return NULL;
#ifdef DEBUG_GETROOT_PARENT
SortedVector<ManagedReference<SceneObject*> > parents;
parents.setNoDuplicateInsertPlan();
#endif
while ((tempParent = grandParent->getParent()) != NULL && grandParent != asSceneObject()) {
grandParent = tempParent;
#ifdef DEBUG_GETROOT_PARENT
if (parents.contains(grandParent))
return NULL;
else
parents.put(grandParent);
#endif
}
if (grandParent == asSceneObject())
return NULL;
ManagedWeakReference<SceneObject*> weak = grandParent.get();
return weak;
}
示例4: destroyObjectFromDatabase
void SceneObjectImplementation::destroyObjectFromDatabase(bool destroyContainedObjects) {
//info("deleting from database", true);
if (isPlayerCreature()) {
assert(0 && "attempting to delete a player creature from database");
}
if(dataObjectComponent != NULL) {
dataObjectComponent->notifyObjectDestroyingFromDatabase();
}
ZoneServer* server = getZoneServer();
server->destroyObjectFromDatabase(getObjectID());
asSceneObject()->setPersistent(0);
if (!destroyContainedObjects)
return;
SortedVector<ManagedReference<SceneObject*> > destroyedObjects;
destroyedObjects.setNoDuplicateInsertPlan();
for (int i = 0; i < getSlottedObjectsSize(); ++i) {
ManagedReference<SceneObject*> object = getSlottedObject(i);
if (destroyedObjects.put(object) != -1) {
Locker locker(object);
object->destroyObjectFromDatabase(true);
}
}
for (int j = 0; j < getContainerObjectsSize(); ++j) {
ManagedReference<SceneObject*> object = getContainerObject(j);
if (destroyedObjects.put(object) != -1) {
Locker locker(object);
object->destroyObjectFromDatabase(true);
}
}
//Remove all child objects from database
for (int i = 0; i < childObjects.size(); ++i) {
ManagedReference<SceneObject*> child = childObjects.get(i);
if (child == NULL)
continue;
Locker locker(child);
child->destroyObjectFromDatabase(true);
}
}
示例5: cleanupCitizens
void CityRegionImplementation::cleanupCitizens() {
Locker slocker(&structureListMutex);
SortedVector<uint64> ownerIds;
ownerIds.setNoDuplicateInsertPlan();
for (int i = 0; i < completeStructureList.size(); ++i) {
uint64 oid = completeStructureList.get(i);
ManagedReference<BuildingObject*> building = Core::getObjectBroker()->lookUp(oid).castTo<BuildingObject*>();
if (building != NULL) {
if (building->isResidence()) {
uint64 owner = building->getOwnerObjectID();
ownerIds.put(owner);
}
}
}
SortedVector<uint64> removeIds;
removeIds.setNoDuplicateInsertPlan();
for (int i = 0; i < citizenList.size(); ++i) {
uint64 id = citizenList.get(i);
if (!ownerIds.contains(id))
removeIds.put(id);
else if (isBanned(id))
removeBannedPlayer(id);
}
for (int i = 0; i < removeIds.size(); ++i) {
removeCitizen(removeIds.get(i));
}
if(getMayorID() != 0 && !isCitizen(getMayorID()))
addCitizen(getMayorID());
}