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


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

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


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

示例1: handleObjectMenuSelect

int TurretControlMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject, CreatureObject* player, byte selectedID) {
	if (sceneObject == NULL || !sceneObject->isTangibleObject() || player == NULL)
		return 0;

	ManagedReference<PlayerObject*> ghost = player->getPlayerObject();
	if (ghost == NULL)
		return 1;

	ManagedReference<BuildingObject*> building = cast<BuildingObject*>(sceneObject->getParentRecursively(SceneObjectType::FACTIONBUILDING).get().get());

	if(building == NULL)
		return 1;

	Zone* zone = building->getZone();

	if(zone == NULL)
		return 1;

	ManagedReference<GCWManager*> gcwMan = zone->getGCWManager();

	if(gcwMan == NULL)
		return 1;

	if(!gcwMan->canUseTerminals(player, building, sceneObject))
		return 1;

	if(selectedID == 222){
		gcwMan->sendTurretAttackListTo(player,sceneObject);
	}

	return 0;
}
开发者ID:Chilastra-Reborn,项目名称:Chilastra-source-code,代码行数:32,代码来源:TurretControlMenuComponent.cpp

示例2: handleObjectMenuSelect

int HQMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject, CreatureObject* creature, byte selectedID) {
	if (creature->isDead() || creature->isIncapacitated())
		return 1;
	ManagedReference<BuildingObject*> building = cast<BuildingObject*>(sceneObject->getParentRecursively(SceneObjectType::FACTIONBUILDING).get().get());

	if(building == NULL)
		return 1;

	Zone* zone = building->getZone();

	if(zone == NULL)
		return 1;

	ManagedReference<GCWManager*> gcwMan = zone->getGCWManager();

	if(gcwMan == NULL)
		return 1;

	if(!gcwMan->canUseTerminals(creature, building, sceneObject))
		return 1;

	if(creature->getFaction() == building->getFaction()) {
		if (selectedID == 20){
			gcwMan->sendStatus(building,creature);
		} else if( selectedID == 228 || selectedID == 20){
				gcwMan->sendBaseDefenseStatus(creature, building);
		} else if ( selectedID == 38) {
				gcwMan->sendResetVerification(creature, building);
		} else if(selectedID == 231) {
			ShutdownSequenceTask* task = new ShutdownSequenceTask(gcwMan, building, creature, false);
			task->execute();
		} else if (selectedID == 226)
				gcwMan->sendSelectDeedToDonate(building,creature,0);
	} else {
		if ( selectedID == 230 ) {
			if(creature->hasSkill("outdoors_squadleader_novice")) {
				ShutdownSequenceTask* task = new ShutdownSequenceTask(gcwMan, building, creature, true);
				task->execute();
			} else
				creature->sendSystemMessage(("@faction/faction_hq/faction_hq_response:terminal_response03")); // only an experienced squad leader could expect to coordinate a reactor overload

		} else if ( selectedID == 20) {

			if(creature->getFactionRank() >= 9) {
				gcwMan->sendStatus(building,creature);
			} else {
				creature->sendSystemMessage("You must be at least a Warrant Officer in order to use this terminal");
			}
		}
	}

	return 0;
}
开发者ID:Chilastra-Reborn,项目名称:Chilastra-source-code,代码行数:53,代码来源:HQMenuComponent.cpp

示例3: handleObjectMenuSelect

int UplinkTerminalMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject, CreatureObject* player, byte selectedID) {
	if (sceneObject == NULL || !sceneObject->isTangibleObject() || player == NULL || player->isDead() || player->isIncapacitated())
		return 0;

	ManagedReference<BuildingObject*> building = cast<BuildingObject*>(sceneObject->getParentRecursively(SceneObjectType::FACTIONBUILDING).get().get());
	ManagedReference<TangibleObject*> uplinkTerminal = cast<TangibleObject*>(sceneObject);

	if (building == NULL)
		return 1;

	Zone* zone = sceneObject->getZone();

	if (zone == NULL)
		return 1;

	ManagedReference<GCWManager*> gcwMan = zone->getGCWManager();

	if (gcwMan == NULL)
		return 1;

	if (!gcwMan->canUseTerminals(player, building, sceneObject))
		return 1;

	if (selectedID == 227 || selectedID == 20) {
		if (player->getFaction() != building->getFaction()) {

			if (player->hasSkill("combat_bountyhunter_investigation_02"))
				gcwMan->sendJamUplinkMenu(player, building, uplinkTerminal);
			else
				player->sendSystemMessage("Only an experienced Bounty Hunter with Investigation experience could expect to jam the uplink");
		}

	}

	return 0;
}
开发者ID:Mesagoppinmypants,项目名称:mtgtestserver,代码行数:36,代码来源:UplinkTerminalMenuComponent.cpp


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