本文整理汇总了C++中ZoneServer::getCityManager方法的典型用法代码示例。如果您正苦于以下问题:C++ ZoneServer::getCityManager方法的具体用法?C++ ZoneServer::getCityManager怎么用?C++ ZoneServer::getCityManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZoneServer
的用法示例。
在下文中一共展示了ZoneServer::getCityManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: destroyObjectFromWorld
void CityHallZoneComponent::destroyObjectFromWorld(SceneObject* sceneObject, bool sendSelfDestroy) const {
ZoneServer* zoneServer = sceneObject->getZoneServer();
if (zoneServer == NULL || zoneServer->isServerShuttingDown()) {
ZoneComponent::destroyObjectFromWorld(sceneObject, sendSelfDestroy);
return;
}
ManagedReference<CityRegion*> cityRegion = sceneObject->getCityRegion().get();
if (cityRegion != NULL ) {
Locker clocker(cityRegion, sceneObject);
if (cityRegion->getCityHall() == sceneObject) {
cityRegion->setCityHall(NULL);
}
clocker.release();
CityManager* cityManager = zoneServer->getCityManager();
cityManager->destroyCity(cityRegion);
}
ZoneComponent::destroyObjectFromWorld(sceneObject, sendSelfDestroy);
}
示例2: notifyExit
void CityRegionImplementation::notifyExit(SceneObject* object) {
//pre: no 2 different city regions should ever overlap, only 2 Regions of the same city region
if (object->isTangibleObject()) {
TangibleObject* tano = cast<TangibleObject*>(object);
ManagedReference<Region*> activeRegion = tano->getActiveRegion().castTo<Region*>();
if (activeRegion != NULL) {
ManagedReference<CityRegion*> city = activeRegion->getCityRegion();
object->setCityRegion(city);
if (city == _this.getReferenceUnsafeStaticCast()) // if its the same city we wait till the object exits the last region
return;
} else {
object->setCityRegion(NULL);
}
} else {
object->setCityRegion(NULL);
}
if (object->isBazaarTerminal() || object->isVendor()) {
if (object->isBazaarTerminal())
bazaars.drop(object->getObjectID());
AuctionTerminalDataComponent* terminalData = NULL;
DataObjectComponentReference* data = object->getDataObjectComponent();
if(data != NULL && data->get() != NULL && data->get()->isAuctionTerminalData())
terminalData = cast<AuctionTerminalDataComponent*>(data->get());
if(terminalData != NULL)
terminalData->updateUID();
}
if (object->isPlayerCreature())
currentPlayers.decrement();
if (isClientRegion())
return;
if (object->isCreatureObject()) {
CreatureObject* creature = cast<CreatureObject*>(object);
StringIdChatParameter params("city/city", "city_leave_city"); //You have left %TO.
params.setTO(getRegionName());
creature->sendSystemMessage(params);
removeSpecializationModifiers(creature);
}
if (object->isStructureObject()) {
float x = object->getWorldPositionX();
float y = object->getWorldPositionY();
StructureObject* structure = cast<StructureObject*>(object);
Locker slocker(&structureListMutex);
if (structure->isBuildingObject()) {
BuildingObject* building = cast<BuildingObject*>(object);
uint64 ownerID = structure->getOwnerObjectID();
ZoneServer* zoneServer = building->getZoneServer();
if (zoneServer != NULL) {
ManagedReference<CreatureObject*> owner = zoneServer->getObject(ownerID).castTo<CreatureObject*>();
if(owner != NULL && owner->isPlayerCreature() && building->isResidence() && isCitizen(ownerID)) {
CityManager* cityManager = zoneServer->getCityManager();
cityManager->unregisterCitizen(_this.getReferenceUnsafeStaticCast(), owner);
}
}
}
completeStructureList.drop(structure->getObjectID());
if (structure->isCivicStructure()) {
removeStructure(structure);
} else if (structure->isCommercialStructure()) {
removeCommercialStructure(structure);
}
}
if (object->isDecoration() && object->getParent().get() == NULL) {
removeDecoration(object);
}
}