Ejemplo n.º 1
0
        public void ShouldGetExpectedGrabDuration(ControllerInput input, int expectedFrames)
        {
            var data = new GrabDurationProblemData
            {
                Input = input,
                TargetPercent = 20
            };

            var result = _calculator.GrabDuration(data);
            Assert.That(result, Is.EqualTo(expectedFrames));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns the calculated grab duration frames.
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public int GrabDuration(GrabDurationProblemData data)
 {
     return (int)(Math.Floor(90 + data.TargetPercent * 1.7) - data.Input.GetModifierValue());
 }