本文整理汇总了C++中DroidComponent::dropSlottedObject方法的典型用法代码示例。如果您正苦于以下问题:C++ DroidComponent::dropSlottedObject方法的具体用法?C++ DroidComponent::dropSlottedObject怎么用?C++ DroidComponent::dropSlottedObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DroidComponent
的用法示例。
在下文中一共展示了DroidComponent::dropSlottedObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void DroidStimpackModuleDataComponent::initialize(CreatureObject* droid) {
// grab the crafted components in this module and remove then
// then change capacity to the new capacity so we store the stims directly in the component.
DroidComponent* droidComponent = cast<DroidComponent*>(getParent());
if (droidComponent == NULL) {
info("droidComponent was null");
return;
}
droidComponent->dropSlottedObject("crafted_components");
ManagedReference<SceneObject*> craftingComponents = droidComponent->getSlottedObject("crafted_components");
if(craftingComponents == NULL) {
// create the satchel and container as it would not be present as this object doesnt use components.
ManagedReference<SceneObject*> craftingComponentsSatchel = NULL;
String craftingComponentsPath = "object/tangible/crafting/crafting_components_container.iff";
craftingComponents = droidComponent->getZoneServer()->createObject(craftingComponentsPath.hashCode(), 1);
craftingComponents->removeAllContainerObjects();
craftingComponents->setSendToClient(false);
droidComponent->transferObject(craftingComponents, 4, false);
Locker locker(craftingComponents);
craftingComponents->setContainerDefaultDenyPermission(ContainerPermissions::OPEN + ContainerPermissions::MOVEIN + ContainerPermissions::MOVEOUT + ContainerPermissions::MOVECONTAINER);
craftingComponents->setContainerDefaultAllowPermission(0);
craftingComponents->setContainerDenyPermission("owner", ContainerPermissions::OPEN + ContainerPermissions::MOVEIN + ContainerPermissions::MOVEOUT + ContainerPermissions::MOVECONTAINER);
craftingComponents->setContainerDenyPermission("admin", ContainerPermissions::OPEN + ContainerPermissions::MOVEIN + ContainerPermissions::MOVEOUT + ContainerPermissions::MOVECONTAINER);
craftingComponents->setContainerAllowPermission("owner", 0);
craftingComponents->setContainerAllowPermission("admin", 0);
craftingComponents->setContainerInheritPermissionsFromParent(false);
locker.release();
String craftingComponentsSatchelPath = "object/tangible/hopper/crafting_station_hopper/crafting_station_ingredient_hopper_large.iff";
craftingComponentsSatchel = droidComponent->getZoneServer()->createObject(craftingComponentsSatchelPath.hashCode(), 1);
Locker locker2(craftingComponentsSatchel);
craftingComponentsSatchel->setContainerVolumeLimit(capacity);
craftingComponentsSatchel->setContainerInheritPermissionsFromParent(false);
craftingComponentsSatchel->setContainerDefaultDenyPermission(ContainerPermissions::OPEN + ContainerPermissions::MOVEIN + ContainerPermissions::MOVEOUT + ContainerPermissions::MOVECONTAINER);
craftingComponentsSatchel->setContainerDefaultAllowPermission(0);
craftingComponentsSatchel->setContainerAllowPermission("admin", ContainerPermissions::OPEN);
craftingComponentsSatchel->setContainerDenyPermission("admin", ContainerPermissions::MOVEIN + ContainerPermissions::MOVEOUT + ContainerPermissions::MOVECONTAINER);
craftingComponentsSatchel->setContainerAllowPermission("owner", 0);
craftingComponentsSatchel->setContainerDenyPermission("owner", ContainerPermissions::OPEN + ContainerPermissions::MOVEIN + ContainerPermissions::MOVEOUT + ContainerPermissions::MOVECONTAINER);
craftingComponentsSatchel->sendTo(droid, true);
craftingComponents->transferObject(craftingComponentsSatchel, -1, false);
}
}