コード例 #1
0
ファイル: Game1.cs プロジェクト: kbo4sho/Swarm
        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();
        }
コード例 #2
0
ファイル: App1.cs プロジェクト: kbo4sho/Swarm
        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();
        }