Exemplo n.º 1
0
        /// <summary>
        /// Initializes the input manager.
        /// </summary>
        public override void Initialize()
        {
            Logger.Trace("init()");

            // import required services.
            this._world                 = (IWorld)this.Game.Services.GetService(typeof(IWorld));
            this._player                = (IPlayer)this.Game.Services.GetService(typeof(IPlayer));
            this._graphicsManager       = (IGraphicsManager)this.Game.Services.GetService(typeof(IGraphicsManager));
            this._cameraController      = (ICameraControlService)this.Game.Services.GetService(typeof(ICameraControlService));
            this._ingameDebuggerService = (IInGameDebuggerService)this.Game.Services.GetService(typeof(IInGameDebuggerService));
            this._fogger                = (IFogger)this.Game.Services.GetService(typeof(IFogger));
            this._skyService            = (ISkyService)this.Game.Services.GetService(typeof(ISkyService));
            this._chunkCache            = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache));
            this._bloomService          = (IBloomService)this.Game.Services.GetService(typeof(IBloomService));

            // get current mouse & keyboard states.
            this._previousKeyboardState = Keyboard.GetState();
            this._previousMouseState    = Mouse.GetState();

            base.Initialize();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the input manager.
        /// </summary>
        public override void Initialize()
        {
            Logger.Trace("init()");

            // import required services.
            this._world = (IWorld) this.Game.Services.GetService(typeof (IWorld));
            this._player = (IPlayer) this.Game.Services.GetService(typeof (IPlayer));
            this._graphicsManager = (IGraphicsManager) this.Game.Services.GetService(typeof (IGraphicsManager));
            this._cameraController = (ICameraControlService) this.Game.Services.GetService(typeof (ICameraControlService));
            this._ingameDebuggerService =(IInGameDebuggerService) this.Game.Services.GetService(typeof (IInGameDebuggerService));
            this._fogger = (IFogger) this.Game.Services.GetService(typeof (IFogger));
            this._skyService = (ISkyService) this.Game.Services.GetService(typeof (ISkyService));
            this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache));
            this._bloomService = (IBloomService) this.Game.Services.GetService(typeof (IBloomService));

            // get current mouse & keyboard states.
            this._previousKeyboardState = Keyboard.GetState();
            this._previousMouseState = Mouse.GetState();

            base.Initialize();
        }