private async void GenerateButtonClickHandlerAsync(object?sender, EventArgs e)
        {
            if (_generationWasStarted)
            {
                // Ignore next clicks to avoid multiple globe creations.
                return;
            }

            _generationWasStarted = true;

            await RegenerateGlobeAsync().ConfigureAwait(false);

            TargetScreen = new MainScreen(Game, _spriteBatch);
        }
        public override void Update(GameTime gameTime)
        {
            if (_player.MainPerson is null)
            {
                throw new InvalidOperationException();
            }

            if (!_transitionPool.CheckPersonInTransition(_player.MainPerson) && !_targetSceneInitialized)
            {
                var playerPersonSectorNode = GetPlayerSectorNode(_player);

                if (playerPersonSectorNode != null)
                {
                    TargetScene             = new MainScreen(Game, _spriteBatch);
                    _targetSceneInitialized = true;
                }
            }
        }
示例#3
0
 private void GoToMainMenuButtonClickHandler(object?sender, EventArgs e)
 {
     TargetScene = new MainScreen(game: Game, spriteBatch: _spriteBatch);
 }