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


C++ SortedVector::setNoDuplicateInsertPlan方法代码示例

本文整理汇总了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;
}
开发者ID:Mesagoppinmypants,项目名称:mtgtestserver,代码行数:25,代码来源:ZoneImplementation.cpp

示例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);
	}
}
开发者ID:Skyyyr,项目名称:GR-Core-TC1,代码行数:28,代码来源:PlanetManagerImplementation.cpp

示例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;
}
开发者ID:JigglyPoofSWG,项目名称:BSS,代码行数:30,代码来源:SceneObjectImplementation.cpp

示例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);
	}
}
开发者ID:angelsounds777,项目名称:Core3-CU,代码行数:53,代码来源:SceneObjectImplementation.cpp

示例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());
}
开发者ID:JigglyPoofSWG,项目名称:BSS,代码行数:38,代码来源:CityRegionImplementation.cpp


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