コード例 #1
0
ファイル: Game1.cs プロジェクト: nordsoyv/GraphicsFun
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            device = graphics.GraphicsDevice;

            Font = Content.Load<SpriteFont>("Console");
            fpsDisplay = new FPSDisplay(device, Font);
            effect = Content.Load<Effect>("effects");
            player = new Player();
            player.Position = new Vector3(0, 0, 0);
            player.Heading = Quaternion.Identity;
            camera = new Camera(device);
            camera.Registerplayer(player);
            landscape = new Landscape.Landscape(device,effect);
            landscape.GenerateLandscape(null);
            commandBox = new CommandBox(device, Content);

            bindingHandler = new KeyBindingHandler();

            ConsoleVarHandler.GetInstance();
            SetDefaultConsoleVars();
            inputHandler = new InputHandler(this.Window);
            exitgameEventHandler= new ExitgameEventHandler(this);
              //  inputHandler.RegisterKeyboardEventReciver();
            inputHandler.RegisterKeyboardEventReciver(commandBox);
            inputHandler.RegisterKeyboardEventReciver(bindingHandler);
            //inputHandler.RegisterKeyboardEventReciver(landscape);
            inputHandler.RegisterKeyboardEventReciver(player);
            inputHandler.RegisterMouseEventReciver(player);

            _consoleOutLogObserver = new ConsoleOutLogObserver();
            _consoleOutCommandObserver = new ConsoleOutCommandObserver();
        }