示例#1
0
        public void MoveTheCat(PositionByDeltaTime testCase)
        {
            var cat           = ACat(withPosition: Vector3.zero, withSpeed: testCase.CatSpeed);
            var anInGameCat   = AnInGameCat(withCat: cat);
            var moveCommander = new MoveCat(anInGameCat);

            moveCommander.Execute(testCase.Direction, testCase.DeltaTime);

            Assert.AreEqual(testCase.ExpectedPosition, anInGameCat.GetPosition());
        }
示例#2
0
        private void Update()
        {
            var h = Input.GetAxis("Horizontal");
            var v = Input.GetAxis("Vertical");

            if (Input.GetKeyDown(KeyCode.Space))
            {
                _jump.Execute(_airForce);
                _catView.MakeJump(_inGameCat.Get());
            }


            if (!(Math.Abs(h) > 0.1f) && !(Math.Abs(v) > 0.1f))
            {
                return;
            }
            _moveCatCat.Execute(new Vector3(h, 0, v), Time.deltaTime);
            _catView.UpdatePosition(_inGameCat.Get());
        }