public void MissileTest1() { var fireSolution = _firingSolutionCalc.CalculateSolution(6, 11, 2, CoilgunAcceleration); var missileAccelData = _firingSolutionCalc.CalculateMissileAcceleration(31, 2, CoilgunAcceleration, fireSolution.AimAdjustment, fireSolution.RoC); fireSolution.RoC.Should().Be(3.5f); missileAccelData.BurnDistance.Should().Be(5f); missileAccelData.ImpulseData.Count.Should().Be(2); var shellstarInfo = _shellstarBuilder.BuildShellstarInfo(31, new TurnData(2, 2), fireSolution, missileAccelData); shellstarInfo.Dmg50.Should().Be(9); shellstarInfo.Dmg100.Should().Be(19); shellstarInfo.Dmg200.Should().Be(38); shellstarInfo.ImpulseTrack.Count.Should().Be(11); shellstarInfo.ImpulseTrack[0].Impulse.Should().Be("2.2"); shellstarInfo.ImpulseTrack[0].IsBurning.Should().BeTrue(); shellstarInfo.ImpulseTrack[0].Range.Should().Be(31); shellstarInfo.ImpulseTrack[1].Impulse.Should().Be("2.3"); shellstarInfo.ImpulseTrack[1].IsBurning.Should().BeTrue(); shellstarInfo.ImpulseTrack[1].Range.Should().Be(29); shellstarInfo.ImpulseTrack[2].Impulse.Should().Be("2.4"); shellstarInfo.ImpulseTrack[2].IsBurning.Should().BeFalse(); shellstarInfo.ImpulseTrack[2].Range.Should().Be(26); shellstarInfo.ImpulseTrack[3].Impulse.Should().Be("2.5"); shellstarInfo.ImpulseTrack[3].IsBurning.Should().BeFalse(); shellstarInfo.ImpulseTrack[3].Range.Should().Be(24); shellstarInfo.ImpulseTrack[9].Impulse.Should().Be("3.3"); shellstarInfo.ImpulseTrack[9].IsBurning.Should().BeFalse(); shellstarInfo.ImpulseTrack[9].Range.Should().Be(3); shellstarInfo.ImpulseTrack[10].Impulse.Should().Be("3.4"); shellstarInfo.ImpulseTrack[10].IsBurning.Should().BeFalse(); shellstarInfo.ImpulseTrack[10].Range.Should().Be(0); }
public void MissileAccelerationTest1() { const int acceleration = 8; var fireSolution = _calculator.CalculateSolution(6, 11, 2, acceleration); var missileAccelData = _calculator.CalculateMissileAcceleration(31, 2, acceleration, fireSolution.AimAdjustment, fireSolution.RoC); fireSolution.RoC.Should().Be(3.5f); missileAccelData.ValidLaunch.Should().BeTrue(); missileAccelData.TotalAcceleration.Should().Be(7f); missileAccelData.TotalPositionAdjustment.Should().Be(2f); missileAccelData.TableColumn.Should().Be(5); missileAccelData.BurnDistance.Should().Be(5f); missileAccelData.TargetRange.Should().Be(31); missileAccelData.ImpulseData.Count.Should().Be(2); missileAccelData.ImpulseData[0].Range.Should().Be(26f); missileAccelData.ImpulseData[0].PositionAdjustment.Should().Be(0.5f); missileAccelData.ImpulseData[1].Range.Should().Be(29f); missileAccelData.ImpulseData[1].PositionAdjustment.Should().Be(1.5f); (missileAccelData.ImpulseData[1].Range + fireSolution.RoC - missileAccelData.ImpulseData[1].PositionAdjustment).Should().Be(missileAccelData.TargetRange); }
public void CalculateFiringSolution() { var firingSolution = _firingSolutionCalculator.CalculateSolution( CourseOffset, CrossingVector.Magnitude, WeaponSelection.MuzzleVelocityMultiplyer, WeaponSelection.Acceleration); MissileAccelerationData missileAccelerationData = null; if (WeaponSelection.IsMissile && firingSolution.AimAdjustment != AimAdjustment.NoShot) { missileAccelerationData = _firingSolutionCalculator.CalculateMissileAcceleration( TargetDistance.Magnitude, WeaponSelection.MuzzleVelocityMultiplyer, WeaponSelection.Acceleration, firingSolution.AimAdjustment, firingSolution.RoC); } IShellstarModel shellstar = BuildShellstar(firingSolution, missileAccelerationData); UpdateFiringSolution(firingSolution, missileAccelerationData, shellstar); }