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


C++ Neighborhood::requestDeleteCurrentInteraction方法代码示例

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


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

示例1: receiveNotification

void PressureDoor::receiveNotification(Notification *notification, const NotificationFlags flags) {
	Neighborhood *owner = getOwner();

	if (notification == _neighborhoodNotification) {
		if (_playingAgainstRobot && (flags & kExtraCompletedFlag) != 0) {
			ExtraTable::Entry entry;

			switch (_robotState) {
			case kPlayingRobotApproaching:
				_utilityTimer.stop();
				if (GameState.getNoradSubRoomPressure() == kMaxPressure) {
					owner->getExtraEntry(kN59PlayerWins1, entry);
					_utilityTimer.setSegment(entry.movieStart, entry.movieEnd);
					_utilityTimer.setTime(entry.movieStart);
					_utilityCallBack.setCallBackFlag(kDoorJumpsUpFlag);
					_punchInTime = kLoopPunchInTime + entry.movieStart;
					_utilityCallBack.scheduleCallBack(kTriggerTimeFwd, _punchInTime, kNavTimeScale);
					owner->startExtraSequence(kN59PlayerWins1, kExtraCompletedFlag, kFilterNoInput);
					_utilityTimer.start();
					_robotState = kRobotDying;
				} else {
					owner->getExtraEntry(kN59RobotPunchLoop, entry);
					_utilityTimer.setSegment(entry.movieStart, entry.movieEnd);
					_utilityTimer.setTime(entry.movieStart);
					_utilityCallBack.setCallBackFlag(kDoorJumpsUpFlag);
					_punchInTime = kLoopPunchInTime + entry.movieStart;
					_utilityCallBack.scheduleCallBack(kTriggerTimeFwd, _punchInTime, kNavTimeScale);
					owner->startSpotLoop(entry.movieStart, entry.movieEnd, kExtraCompletedFlag);
					_utilityTimer.start();
					_robotState = kRobotPunching;
					_punchCount = 1;
				}
				break;
			case kRobotPunching:
				if (GameState.getNoradSubRoomPressure() == kMaxPressure) {
					owner->startExtraSequence(kN59PlayerWins1, kExtraCompletedFlag, kFilterNoInput);
					_robotState = kRobotDying;
				} else if (++_punchCount >= kMaxPunches) {
					_robotState = kRobotComingThrough;
					owner->getExtraEntry(kN59RobotWins, entry);
					_utilityTimer.stop();
					_utilityTimer.setSegment(entry.movieStart, entry.movieEnd);
					_utilityTimer.setTime(entry.movieStart);
					_utilityCallBack.cancelCallBack();
					_utilityCallBack.setCallBackFlag(kDoorCrushedFlag);
					_utilityCallBack.scheduleCallBack(kTriggerTimeFwd, kPunchThroughTime + entry.movieStart, kNavTimeScale);
					owner->startExtraSequence(kN59RobotWins, kExtraCompletedFlag, kFilterNoInput);
					_utilityTimer.start();
				} else {
					_utilityCallBack.setCallBackFlag(kDoorJumpsUpFlag);
					_utilityCallBack.scheduleCallBack(kTriggerTimeFwd, _punchInTime, kNavTimeScale);
					owner->scheduleNavCallBack(kExtraCompletedFlag);
				}
				break;
			case kRobotComingThrough:
				g_system->delayMillis(2 * 1000);
				((PegasusEngine *)g_engine)->die(kDeathRobotThroughNoradDoor);
				break;
			case kRobotDying:
				_robotState = kRobotDead;
				_levelsMovie.stop();
				_levelsMovie.setSegment((kNormalSubRoomPressure + kPressureBase) * _levelsScale,
						(GameState.getNoradSubRoomPressure() + kPressureBase) * _levelsScale + 1);
				_levelsMovie.setTime((GameState.getNoradSubRoomPressure() + kPressureBase) * _levelsScale);
				_pressureCallBack.setCallBackFlag(kPressureDroppingFlag);
				_pressureCallBack.scheduleCallBack(kTriggerAtStart, 0, 0);
				_typeMovie.stop();
				_typeMovie.setSegment(0, _typeMovie.getDuration());
				_typeMovie.setTime(kDecreasingPressureTime * _typeScale);
				_typeMovie.redrawMovieWorld();
				_typeMovie.show();
				_downButton.show();
				_downButton.setCurrentFrameIndex(1);
				_gameState = kGameOver;
				allowInput(false);
				_levelsMovie.setRate(Common::Rational(-4, 3)); // Should match door tracker.
				break;
			case kRobotDead:
				allowInput(true);
				((NoradDelta *)owner)->playerBeatRobotWithDoor();
				owner->requestDeleteCurrentInteraction();
				break;
			}
		}

		if ((flags & (kDelayCompletedFlag | kSpotSoundCompletedFlag)) != 0) {
			switch (_gameState) {
			case kPlayingPressureMessage:
				_typeMovie.setTime(kEqualizeTime * _typeScale);
				_typeMovie.redrawMovieWorld();
				owner->requestDelay(1, 5, kFilterNoInput, 0);
				owner->requestSpotSound(_equalizeSoundIn, _equalizeSoundOut, kFilterNoInput, 0);
				owner->requestDelay(1, 5, kFilterNoInput, kDelayCompletedFlag);
				_gameState = kPlayingEqualizeMessage;
				break;
			case kPlayingEqualizeMessage:
				_gameState = kWaitingForPlayer;
				stopChangingPressure();
				break;
			case kPlayingDoneMessage:
//.........这里部分代码省略.........
开发者ID:AlbanBedel,项目名称:scummvm,代码行数:101,代码来源:pressuredoor.cpp


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