Exemple #1
0
        protected override void Initialize()
        {
            Items.Initialize(Content);
            AdGameComponent.Initialize(this, ApplicationId);
            Components.Add(AdGameComponent.Current);
            GameState gameState = TestData.CreateDefaultGameState(this);
            Services.AddService(gameState);

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

            var cache = new GameCache();
            Services.AddService(cache);

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

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

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

            _screenManager = new ScreenManager(this);
            Components.Add(_screenManager);
            Services.AddService(typeof(ScreenManager), _screenManager);

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

            base.Initialize();
            LoadingScreen.Load(_screenManager, false, new AlternativeMenuScreen());
        }
Exemple #2
0
 public ResourceBuilder(InventoryMappingService mappingService)
 {
     _mappingService = mappingService;
 }
Exemple #3
0
 protected override void OnStart(GameState state)
 {
     _currentTime = 0;
     _inventoryMappingService = _game.Services.GetService<InventoryMappingService>();
     PickTarget.IsBeingPicked = true;
     base.OnStart(state);
 }