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));
        }
Exemple #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());
 }