Extends the EngineCore to compile with the application's graphic interface.
Inheritance: BalloonsPop.Core.EngineCore
Beispiel #1
0
        /// <summary>
        /// This override sets up the balloons app.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var kernel = new StandardKernel();
            kernel.Bind<ILogger>().ToMethod(x => LogHelper.GetLogger());
            DependancyBinder.Instance
                .RegisterModules(
                                 new ModelsModule(kernel),
                                 new LogicModule(kernel),
                                 new ValidationModule(kernel),
                                 new WpfCommandModule(kernel),
                                 new HighscoreModule(kernel),
                                 new SaverModule(kernel),
                                 new WpfModule(kernel),
                                 new SoundsModule(kernel))
                .LoadAll();

            var bundle = new WpfBundle(kernel);
            var ctx = new Context(kernel);
            var engine = new EventEngine(ctx, bundle);

            this.engine = engine;

            bundle.Gui.Show();
        }
Beispiel #2
0
        public EventEngineTests()
        {
            this.kernel = new StandardKernel();
            this.kernel.Bind<ILogger>().ToMethod(x => LogHelper.GetLogger());
            DependancyBinder.Instance
                .RegisterModules(
                                 new ModelsModule(this.kernel),
                                 new LogicModule(this.kernel),
                                 new ValidationModule(this.kernel),
                                 new WpfCommandModule(this.kernel),
                                 new HighscoreModule(this.kernel),
                                 new SaverModule(this.kernel),
                                 new WpfModule(this.kernel),
                                 new SoundsModule(this.kernel))
                .LoadAll();

            this.bundle = new WpfBundle(this.kernel);
            this.ctx = new Context(this.kernel);
            this.engine = new EventEngine(this.ctx, this.bundle);
            this.view = new BalloonsView();
            this.resources = new Resources();
            this.controller = new MainWindowController(this.view, this.resources);
        }