private void ProcessState()
        {
            switch (currentState)
            {
            case GameRoundState.STARTING:
                timeRemaining = waitTime;
                currentState  = GameRoundState.WAITING;
                break;

            case GameRoundState.WAITING:
                timeRemaining = roundLength;

                currentRound++;
                OnRoundChange?.Invoke(currentRound);

                currentState = GameRoundState.RUNNING;
                OnRoundStart?.Invoke(currentRound);
                break;

            case GameRoundState.RUNNING:
                timeRemaining = waitTime;

                currentState = GameRoundState.WAITING;
                OnRoundFinished?.Invoke(currentRound);
                break;
            }
        }
Example #2
0
 public void Register_RoundChange_Event(OnRoundChange ev)
 {
     _roundChangeEvent += ev;
 }