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:
Meta Vens 2026-10-16 22:01:56 +02:00
commit 2ff48d0b45
10 changed files with 800 additions and 12 deletions

View file

@ -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);
}