Exemplo n.º 1
0
        protected override void Initialize()
        {
            Items.Initialize(Content);

            GameState gameState = TestData.CreateDefaultGameState(this);
            Services.AddService(gameState);

            // Inventory
            Services.AddService(gameState.Inventory);

            var inventoryMappingService = new InventoryMappingService();
            Services.AddService(inventoryMappingService);

            InputManager.Initialize();
            Fonts.Initialize(this);
            SoundManager.Initialize(this);

            var twitter = TwitterProxy.From(TwitterSettingsFile);
            twitter.Initialize();
            Services.AddService(typeof(ITwitter), twitter);

            Exiting += (o, e) => twitter.SaveTo(TwitterSettingsFile);

            _spriteBatch = new SpriteBatch(GraphicsDevice);
            Services.AddService(typeof (SpriteBatch), _spriteBatch);

            var screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            var menuBackgroundComponent = new MenuBackgroundComponent(this, screenManager);
            menuBackgroundComponent.DrawOrder = -1;
            Components.Add(menuBackgroundComponent);

            InitActions();

            base.Initialize();

            LoadingScreen.Load(screenManager, false, new MainMenuScreen());
        }
Exemplo n.º 2
0
 public ResourceBuilder(InventoryMappingService mappingService)
 {
     _mappingService = mappingService;
 }
Exemplo n.º 3
0
 protected override void OnStart(GameState state)
 {
     _currentTime = 0;
     _inventoryMappingService = _game.Services.GetService<InventoryMappingService>();
     PickTarget.IsBeingPicked = true;
     base.OnStart(state);
 }