Beispiel #1
0
 public Menu(IntentProvider intentProvider, SpriteBatch spriteBatch, SpriteFont font)
 {
     _intentProvider = intentProvider;
     _spriteBatch    = spriteBatch;
     _defaultFont    = font;
     _menuItems      = new List <MenuItem>();
 }
Beispiel #2
0
 public PlayerInputHandlingSystem(
     IntentProvider intentProvider,
     ConfigurationService configurationService)
 {
     _intentProvider = intentProvider;
     _tileSize       = configurationService.GetTileSizeInPixels();
     SystemMessageBroker.AddListener <EntityCreated>(this);
 }
Beispiel #3
0
 protected Screen(ScreenDependencies dependencies)
 {
     ContentManager   = dependencies.ContentManager;
     ScreenManager    = dependencies.ScreenManager;
     SpriteBatch      = dependencies.SpriteBatch;
     Session          = dependencies.Session;
     InputMapProvider = dependencies.InputMapProvider;
     IntentProvider   = dependencies.IntentProvider;
 }
Beispiel #4
0
        public override void Update(GameTime gameTime, bool isActive)
        {
            if (IntentProvider.GetIntents().Any(x => x is ConfirmIntent))
            {
                InputMapProvider.GetContextById(Contexts.Menu).Deactivate();

                Session.TryGet(SessionKeys.CurrentStageId, out int stageId);
                Session.Set(SessionKeys.CurrentStageId, stageId + 1);

                var gameplay = ScreenManager.Peek <GameplayScreen>();
                ScreenManager.Push <GameplayScreen>();
            }
        }
Beispiel #5
0
        public override void Update(GameTime gameTime, bool isActive)
        {
            var intents = IntentProvider.GetIntents().ToArray();

            if (!intents.Any())
            {
                return;
            }

            if (intents[0] is ConfirmIntent)
            {
                InputMapProvider.GetContextById(Contexts.Menu).Deactivate();

                var gameplay = ScreenManager.Peek <GameplayScreen>();
                ScreenManager.Push <GameplayScreen>();
            }
        }