本文整理汇总了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);
}
示例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);
}