public override void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { if (e.NewState == RoomState.Uninitialized) { Debug.Assert(writer == null); //if (writer != null) // endRecord(); StartRecord(); } Record(new RoomStateTransition(e.OldState, e.NewState)); if (e.NewState == RoomState.Initialized && e.DiagnosticsReport.FailuresDetected) { Record(new TechnicalFailuresNotification(e.DiagnosticsReport)); } if (e.NewState == RoomState.Completed || e.NewState == RoomState.Aborted) { EndRecord(); } if (e.NewState == RoomState.Error) { Record(new TechnicalFailuresNotification(e.DiagnosticsReport)); EndRecord(); } }
public void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { if (e.NewState == RoomState.Completed || e.NewState == RoomState.Initialized) { foreach (Camera cam in craneCameras) { ; } } // cam.enabled = false; }
public void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { lblRoomState.text = e.NewState.ToString(); lblRoomState.color = ColorCode(room.State); btnStart.interactable = room.State.CanTransition(RoomState.Running); btnComplete.interactable = room.State.CanTransition(RoomState.Completed); btnAbort.interactable = room.State.CanTransition(RoomState.Aborted); btnReset.interactable = room.State.CanTransition(RoomState.Initialized); chkMaintenance.isOn = maintenanceMode.enabled; chkLighting.isOn = room.Physical.OverrideLighting; }
public override void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { if (e.NewState == RoomState.Initialized) { audio.PlaySound(ConfirmationSound); } if (e.NewState == RoomState.Error) { audio.PlaySound(ErrorSound); } }
public override void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { if (e.NewState == RoomState.Uninitialized) { // start a new record Scores = new Scores(); } if (e.NewState == RoomState.Completed || e.NewState == RoomState.Aborted) { Scores.WriteTXT(Ets.AnalyticsPath + filename); } }
public override void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { if (e.NewState == RoomState.Initialized) { SwitchAllLights(LightSetting.Off); foreach (Fan fan in Room.GetGame <PipesGame>().Fans()) { Physical.SetFanState(fan.Row, fan.PositionInRow, false); } Color[] ledsOff = new Color[TriggersGame.LedCount]; Physical.SetLEDColors(ledsOff); } }
public void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { roomRunning = e.NewState == RoomState.Running; //Debug.Log("GCP.OnRoomStateChanged: " + state); if (!roomRunning) { lblState.text = "Room not running"; lblState.color = RoomControlPanel.TextUninitialized; DisableButtons(); } else { UpdateUI(game.State); } }
public void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { if (e.NewState == RoomState.Initialized) { float maxTimeInGames = RoomMaster.MaxTimePipes + RoomMaster.MaxTimeCrates + RoomMaster.MaxTimeDynamite + RoomMaster.MaxTimeTriggers; float totalAudioTime = 0; foreach (int voiceNumber in betweenGamesVoiceNumbers) { totalAudioTime += audio.GetVoiceLength(voiceNumber); } timeLeft = maxTimeInGames + totalAudioTime; failuresDetected = e.DiagnosticsReport.FailuresDetected; } if (e.NewState == RoomState.Running) { //lblTime.gameObject.SetActive(true); lblDoNotEnter.SetActive(true); lblGameInProgress.SetActive(true); lblPleaseWait.SetActive(false); lblComing.SetActive(false); lblScoreCaptionPrevious.SetActive(false); lblScoreCaptionCurrent.SetActive(true); lblScorePipes.text = "-"; lblScoreCrane.text = "-"; lblScoreDynamite.text = "-"; lblScoreTrigger.text = "-"; } if (e.NewState != RoomState.Running) { lblScoreCaptionPrevious.SetActive(true); lblScoreCaptionCurrent.SetActive(false); } if (e.NewState == RoomState.Initialized) { //lblTime.gameObject.SetActive(false); lblTime.text = "00:00"; lblDoNotEnter.SetActive(false); lblGameInProgress.SetActive(false); lblPleaseWait.SetActive(true); lblComing.SetActive(true); } }
public override void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { switch (e.NewState) { case RoomState.Uninitialized: break; case RoomState.Initialized: break; case RoomState.Running: StopAllCoroutines(); audio.StopAllVoice(); audio.StopAllSounds(); StartCoroutine(StartRoom()); break; case RoomState.Completed: StopAllCoroutines(); audio.StopAllVoice(); audio.StopAllSounds(); StartCoroutine(CompleteRoomEffects()); StartCoroutine(CompleteRoomVoiceover()); LogTimes(); break; case RoomState.Aborted: StopAllCoroutines(); audio.StopAllVoice(); audio.StopAllSounds(); StartCoroutine(AbortRoom()); LogTimes(); break; case RoomState.Error: StopAllCoroutines(); break; default: throw new NotImplementedException("RoomState not handled: " + e.NewState); } }
public override void OnRoomStateChanged(EscapeRoom <IEtsInterface> sender, RoomStateChangedEventArgs e) { if (e.NewState == RoomState.Uninitialized) { // start a new record Statistics = new Statistics(); PipesGame pipes = sender.GetGame <PipesGame>(); foreach (PipeSystem ps in pipes.PipeSystems()) { Statistics.valvesTurnedPerSubsystem[ps.Index] = 0; Statistics.runningFansPerSubsystem[ps.Index] = 0; } } if (e.NewState == RoomState.Completed || e.NewState == RoomState.Aborted) { // write active record to file Statistics.WriteCSV(Ets.AnalyticsPath + filename); } }
/// <inheritdoc/> public virtual void OnRoomStateChanged(EscapeRoom <TPhysicalInterface> sender, RoomStateChangedEventArgs e) { }