Beispiel #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();
        }
Beispiel #2
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();
        }
Beispiel #3
0
 public SwarmScreenBase(IEmitterComponent emitterComponent, IAnalysisComponent analysisComponent, PopulationSimulator populationSimulator)
 {
     ButtonSection            = new ButtonSection(false, this, "");
     swarmInXOrder            = new List <Individual>();
     supers                   = new Dictionary <int, Individual>();
     groups                   = new ControlGroups();
     this.emitterComponent    = emitterComponent;
     this.populationSimulator = populationSimulator;
     this.analysisComponent   = analysisComponent;
 }
 public SwarmEmitterComponent(PopulationSimulator simulator)
 {
     populationSimulator = simulator;
     Emitters            = new List <EmitterBase>();
     Emitters.Add(new BrushEmitter(new Vector2(0, 0)));
 }
Beispiel #5
0
 public SwarmScreen1(IEmitterComponent emitterComponent, IAnalysisComponent analysisComponent, PopulationSimulator populationSimulator)
     : base(emitterComponent, analysisComponent, populationSimulator)
 {
 }