Merge origin/master (da6fe033) into faction-play-1
Combat.cs: master's lazy optimum-range owner kept, the OptimumRange accessor beside it. FireControlPerWeaponTests: the exponent test runs the first Update before reading the optimum (master derives it there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
2ff48d0b45
10 changed files with 800 additions and 12 deletions
|
|
@ -750,8 +750,12 @@ public sealed class FireControlPerWeaponTests : IDisposable
|
|||
public void TheDoctrinesExponentMovesTheOptimumRange()
|
||||
{
|
||||
var r = Build(range: 400f, decoy: true);
|
||||
float Optimum(float exponent) =>
|
||||
new CombatState(new Minion(r.Shooter, new RoleDoctrine { RangeExponent = exponent, MinHitProbability = .2f })).OptimumRange;
|
||||
float Optimum(float exponent)
|
||||
{
|
||||
var combat = new CombatState(new Minion(r.Shooter, new RoleDoctrine { RangeExponent = exponent, MinHitProbability = .2f }));
|
||||
combat.Update(0f); // the optimum is derived at the first Update
|
||||
return combat.OptimumRange;
|
||||
}
|
||||
|
||||
Assert.True(Optimum(1f) - Optimum(0f) > 100f);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue