ProcessInput() 공개 메소드

public ProcessInput ( ) : void
리턴 void
예제 #1
0
        public void ProcessSpaceInputTest()
        {
            Spaceship spaceship = new Spaceship();
            InputManager input = new InputManager();
            PrivateObject privateInput = new PrivateObject(input);
            privateInput.SetField("currentState", new KeyboardState(Keys.Space));

            SpaceshipController controller = new SpaceshipController(spaceship, input);

            controller.ProcessInput();
            Assert.IsTrue(spaceship.BeamOn);
        }
예제 #2
0
        public void RightInputTest()
        {
            Spaceship spaceship = new Spaceship();
            InputManager input = new InputManager();
            PrivateObject privateInput = new PrivateObject(input);
            privateInput.SetField("currentState", new KeyboardState(Keys.D));

            SpaceshipController controller = new SpaceshipController(spaceship, input);

            spaceship.X = 0;
            controller.ProcessInput();
            Assert.AreEqual(0 + spaceship.Speed, spaceship.X);
        }