Esempio n. 1
0
        public Engine(IoCContainer container)
        {
            _container = container;
#if DEBUG_REFERENCES
            SharpDX.Configuration.EnableObjectTracking     = true;
            SharpDX.Configuration.EnableReleaseOnFinalizer = true;
#endif
            IDeviceContextService deviceContextService = _container.Resolve <IDeviceContextService>();

            _form    = deviceContextService.Form;
            _context = deviceContextService.Context;

            _form.Icon         = Resources.openuo;
            _form.Text         = string.Format("OpenUO v{0}", new AssemblyInfo(Assembly.GetEntryAssembly()).Version);
            _form.ResizeBegin += OnResizeBegin;
            _form.ResizeEnd   += OnResizeEnd;
            _form.FormClosed  += OnFormClosed;

            _updateState = new UpdateState();
            _gameTime    = new GameTime();
            _world       = new World(container);

            container.Resolve <IConsole>().WriteLine("Testing 123");

            _config           = _container.Resolve <IConfiguration>();
            _updateChain      = _container.Resolve <IChain <UpdateState> >();
            _worldRenderChain = _container.Resolve <IWorldRenderChain>();
            _uiRenderChain    = _container.Resolve <IUIRenderChain>();

            _screenTarget = new DrawScreenTarget(_context);

            _updateChain.Freeze();
            _worldRenderChain.Freeze();
            _uiRenderChain.Freeze();
        }
Esempio n. 2
0
        public Engine(IoCContainer container)
        {
            _container = container;
            #if DEBUG_REFERENCES
            SharpDX.Configuration.EnableObjectTracking = true;
            SharpDX.Configuration.EnableReleaseOnFinalizer = true;
            #endif
            IDeviceContextService deviceContextService = _container.Resolve<IDeviceContextService>();

            _form = deviceContextService.Form;
            _context = deviceContextService.Context;

            _form.Icon = Resources.openuo;
            _form.Text = string.Format("OpenUO v{0}", new AssemblyInfo(Assembly.GetEntryAssembly()).Version);
            _form.ResizeBegin += OnResizeBegin;
            _form.ResizeEnd += OnResizeEnd;
            _form.FormClosed += OnFormClosed;

            _updateState = new UpdateState();
            _gameTime = new GameTime();
            _world = new World(container);

            container.Resolve<IConsole>().WriteLine("Testing 123");

            _config = _container.Resolve<IConfiguration>();
            _updateChain = _container.Resolve<IChain<UpdateState>>();
            _worldRenderChain = _container.Resolve<IWorldRenderChain>();
            _uiRenderChain = _container.Resolve<IUIRenderChain>();

            _screenTarget = new DrawScreenTarget(_context);

            _updateChain.Freeze();
            _worldRenderChain.Freeze();
            _uiRenderChain.Freeze();
        }