本文整理汇总了C++中Zone::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ Zone::insert方法的具体用法?C++ Zone::insert怎么用?C++ Zone::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone::insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transferObject
bool ZoneContainerComponent::transferObject(SceneObject* sceneObject, SceneObject* object, int containmentType, bool notifyClient, bool allowOverflow, bool notifyRoot) {
Zone* newZone = dynamic_cast<Zone*>(sceneObject);
Zone* zone = object->getZone();
if (object->isActiveArea())
return insertActiveArea(newZone, dynamic_cast<ActiveArea*>(object));
Locker zoneLocker(newZone);
if (object->isInQuadTree() && newZone != zone) {
object->error("trying to insert to zone an object that is already in a different quadtree");
object->destroyObjectFromWorld(true);
return false;
//StackTrace::printStackTrace();
}
ManagedReference<SceneObject*> parent = object->getParent().get();
if (parent != NULL/* && parent->isCellObject()*/) {
uint64 parentID = object->getParentID();
if (containmentType == -2)
parent->removeObject(object, sceneObject, false);
else
parent->removeObject(object, sceneObject, true);
if (object->getParent() != NULL && parent->containsChildObject(object))
return false;
else
object->setParent(NULL);
if (parent->isCellObject()) {
ManagedReference<BuildingObject*> build = cast<BuildingObject*>(parent->getParent().get().get());
if (build != NULL) {
CreatureObject* creature = cast<CreatureObject*>(object);
if (creature != NULL)
build->onExit(creature, parentID);
}
}
} else {
object->setParent(NULL);
}
object->setZone(newZone);
zone = newZone;
zone->addSceneObject(object);
if (notifyClient)
object->sendToOwner(true);
if (parent == NULL)
object->initializePosition(object->getPositionX(), object->getPositionZ(), object->getPositionY());
zone->insert(object);
zone->inRange(object, ZoneServer::CLOSEOBJECTRANGE);
if (object->isTangibleObject()) {
TangibleObject* tano = cast<TangibleObject*>(object);
zone->updateActiveAreas(tano);
}
SharedBuildingObjectTemplate* objtemplate = dynamic_cast<SharedBuildingObjectTemplate*>(object->getObjectTemplate());
if (objtemplate != NULL) {
String modFile = objtemplate->getTerrainModificationFile();
if (!modFile.isEmpty()) {
newZone->getPlanetManager()->getTerrainManager()->addTerrainModification(object->getWorldPositionX(), object->getWorldPositionY(), modFile, object->getObjectID());
}
}
object->notifyInsertToZone(zone);
return true;
}