Beispiel #1
0
 public async Task Run()
 {
     _logger.LogInformation("Runmode starting");
     _modeBase.Start();
     while (!_stopToken.ShouldStop)
     {
         // TODO run main loop goes here
         await Task.Delay(TimeSpan.FromMilliseconds(100));
     }
     _logger.LogInformation("Runmode ended");
 }
Beispiel #2
0
 public async Task Run()
 {
     _logger.LogInformation("Dualcore mode starting");
     _modeBase.Start();
     while (!_stopToken.ShouldStop)
     {
         // there is no sequence, just busyloop
         await Task.Delay(TimeSpan.FromMilliseconds(100));
     }
     _logger.LogInformation("Dualcore mode ended");
 }
Beispiel #3
0
    private IEnumerator IntroDo()
    {
        Mode.Board = SimpleGame.Board;
        Mode.Setup(this);

        SimpleGame.UI.Show("Intro");

        IntroTimer.text = "Ready";
        yield return(new WaitForSeconds(1f));

        IntroTimer.text = "Set";
        yield return(new WaitForSeconds(1f));

        IntroTimer.text = "Go!";
        yield return(new WaitForSeconds(0.5f));

        SimpleGame.UI.Show("HUD");
        Mode.Start();
    }
Beispiel #4
0
        public async Task Run()
        {
            _logger.LogInformation("Matchmode starting");
            _modeBase.Start();
            Task overlayWebsocketTask = _broadcastServer.Listen();

            while (!_stopToken.ShouldStop)
            {
                _loopCancelToken = new CancellationTokenSource();
                try
                {
                    await Loop(_loopCancelToken.Token);
                }
                catch (OperationCanceledException)
                {
                    _logger.LogInformation("Match loop cancelled");
                }
            }
            await _broadcastServer.Stop();

            await overlayWebsocketTask;

            _logger.LogInformation("Matchmode ended");
        }