Exemplo n.º 1
0
        protected override void Initialize()
        {
            ScreenManager screenManager = new ScreenManager(this);
            this.Components.Add(screenManager);

            var backgroundscreen = new BackgroundScreen();
            screenManager.AddScreen(backgroundscreen);

            var debugScreen = new DebugScreen(screenManager, false);
            screenManager.Game.Components.Add(debugScreen);
            this.Services.AddService(typeof(IDebugScreen), debugScreen);

            //Recipe[] recipes = new Recipe[1];
            //recipes[0] = new Recipe(StockRecipies.Stable_A);
            PopulationSimulator populationSimulator = new PopulationSimulator(0, 0);

            var swarmEmitterComponent = new SwarmEmitterComponent(populationSimulator);

            var swarmAnalysisComponent = new SwarmAnalysisComponent(this.Services.GetService(typeof(IDebugScreen)) as IDebugScreen);

            SwarmScreen1 swarmScreen = new SwarmScreen1(swarmEmitterComponent, swarmAnalysisComponent, populationSimulator);
            screenManager.AddScreen(swarmScreen);

            #if NETFX_CORE
            ControlClient controlClient = new ControlClient(swarmScreen, this.Services.GetService(typeof(IAudio)) as IAudio);
            #else
            ControlClient controlClient = new ControlClient(swarmScreen));
            #endif
            this.Services.AddService(typeof(IControlClient), controlClient);

            base.Initialize();
            //SoundEngine.Init();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            ScreenManager screenManager = new ScreenManager(this);
            this.Components.Add(screenManager);

            var backgroundscreen = new BackgroundScreen();
            screenManager.AddScreen(backgroundscreen);

            var debugScreen = new DebugScreen(screenManager, false);
            screenManager.Game.Components.Add(debugScreen);
            this.Services.AddService(typeof(IDebugScreen), debugScreen);

            SwarmScreen1 swarmScreen = new SwarmScreen1(StockRecipies.Stable_A, false);
            screenManager.AddScreen(swarmScreen);
            base.Initialize();
        }
Exemplo n.º 3
0
        protected override void Initialize()
        {
            SetWindowOnSurface();

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

            var backgroundscreen = new BackgroundScreen();
            screenManager.AddScreen(backgroundscreen);

            var debugScreen = new DebugScreen(screenManager,false);
            screenManager.Game.Components.Add(debugScreen);
            this.Services.AddService(typeof(IDebugScreen), debugScreen);

            PopulationSimulator populationSimulator = new PopulationSimulator(0,0);

            var swarmEmitterComponent = new SwarmEmitterComponent(populationSimulator);

            var swarmAnalysisComponent = new SwarmAnalysisComponent(this.Services.GetService(typeof(IDebugScreen)) as IDebugScreen);

            SwarmScreen1 swarmScreen = new SwarmScreen1(swarmEmitterComponent, swarmAnalysisComponent, populationSimulator);
            screenManager.AddScreen(swarmScreen);

            ControlClient controlClient = new ControlClient(swarmScreen, swarmAnalysisComponent);
            this.Services.AddService(typeof(IControlClient), controlClient);

            base.Initialize();
            SoundEngine.Init();
        }