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


C++ ManagedReference::executeObjectControllerAction方法代码示例

本文整理汇总了C++中ManagedReference::executeObjectControllerAction方法的典型用法代码示例。如果您正苦于以下问题:C++ ManagedReference::executeObjectControllerAction方法的具体用法?C++ ManagedReference::executeObjectControllerAction怎么用?C++ ManagedReference::executeObjectControllerAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ManagedReference的用法示例。


在下文中一共展示了ManagedReference::executeObjectControllerAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: destroyObjectFromDatabase

void PetControlDeviceImplementation::destroyObjectFromDatabase(bool destroyContainedObjects) {
	ManagedReference<TangibleObject*> controlledObject = this->controlledObject.get();

	if (controlledObject != NULL) {
		Locker locker(controlledObject);

		ManagedReference<CreatureObject*> object = controlledObject->getSlottedObject("rider").castTo<CreatureObject*>();

		if (object != NULL) {
			Locker clocker(object, controlledObject);

			object->executeObjectControllerAction(STRING_HASHCODE("dismount"));

			object = controlledObject->getSlottedObject("rider").castTo<CreatureObject*>();

			if (object != NULL) {
				controlledObject->removeObject(object, NULL, true);

				Zone* zone = getZone();

				if (zone != NULL)
					zone->transferObject(object, -1, false);
			}
		}

		controlledObject->destroyObjectFromDatabase(true);
	}

	IntangibleObjectImplementation::destroyObjectFromDatabase(destroyContainedObjects);
}
开发者ID:Marott1,项目名称:Core3,代码行数:30,代码来源:PetControlDeviceImplementation.cpp

示例2: notifyObjectDestructionObservers

int VehicleObjectImplementation::notifyObjectDestructionObservers(TangibleObject* attacker, int condition) {
	unlock();

	ManagedReference<CreatureObject* > linkedCreature = this->linkedCreature.get();

	if (linkedCreature != NULL) {
		linkedCreature->sendSystemMessage("@pet/pet_menu:veh_disabled");

		ManagedReference<VehicleObject*> vehicle = _this.getReferenceUnsafeStaticCast();
		String vehicleName = vehicle->getDisplayedName();
		if (!vehicleName.beginsWith("(disabled)"))
		{
			UnicodeString disabledName = "(disabled) " + vehicleName;
			vehicle->setCustomObjectName(disabledName, true);
		}

		try {
			if (attacker != _this.getReferenceUnsafeStaticCast()) {
				Locker clocker(linkedCreature, attacker);

				linkedCreature->updateCooldownTimer("mount_dismount", 0);
				linkedCreature->executeObjectControllerAction(STRING_HASHCODE("dismount"));

			} else {
				Locker locker(linkedCreature);

				linkedCreature->updateCooldownTimer("mount_dismount", 0);
				linkedCreature->executeObjectControllerAction(STRING_HASHCODE("dismount"));
			}


		} catch (Exception& e) {
		}
	}

	if (attacker != _this.getReferenceUnsafeStaticCast())
		wlock(attacker);
	else
		wlock();

	return CreatureObjectImplementation::notifyObjectDestructionObservers(attacker, condition);
}
开发者ID:Mesagoppinmypants,项目名称:mtgtestserver,代码行数:42,代码来源:VehicleObjectImplementation.cpp


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