예제 #1
0
        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();
            }
        }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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);
            }
        }
예제 #6
0
        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);
            }
        }
예제 #7
0
        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);
            }
        }
예제 #8
0
        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);
            }
        }
예제 #9
0
        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);
            }
        }
예제 #10
0
        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);
            }
        }
예제 #11
0
 /// <inheritdoc/>
 public virtual void OnRoomStateChanged(EscapeRoom <TPhysicalInterface> sender, RoomStateChangedEventArgs e)
 {
 }