예제 #1
0
파일: Engine.cs 프로젝트: xposure/Worm
        protected override void Initialize()
        {
            _logger.LogInformation("Init");

            _serviceContainer.RegisterInstance(this);
            _serviceContainer.RegisterInstance(GraphicsDevice);
            _serviceContainer.RegisterInstance(graphics);

            _serviceContainer.RegisterInstance <ILoggerFactory>(_logFactory);
            _serviceContainer.Register(typeof(ILogger <>), typeof(Logger <>));
            _serviceContainer.RegisterSingleton(typeof(IAllocator), typeof(HeapAllocator));
            _serviceContainer.RegisterSingleton(typeof(EntityManager), typeof(EntityManager));
            _serviceContainer.RegisterSingleton(typeof(IEventManager), typeof(EventManager));
            _serviceContainer.RegisterSingleton(typeof(IAutoEventManager), typeof(AutoEventManager));

            _services = new GameServiceManager(typeof(Engine).Assembly, _serviceContainer, _logFactory);

            _serviceContainer.Verify();

            _services.Initialize();

            Reload();

            _geeReloadTask = Task.Run(() => CheckGEE());
            base.Initialize();

            Window.AllowUserResizing = true;
            Window.IsBorderless      = true;
            Window.AllowAltF4        = true;
        }