diff --git a/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs b/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs index 8895b02..e549f38 100644 --- a/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs +++ b/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs @@ -47,27 +47,12 @@ namespace CounterDrone.Core.Tests if (Directory.Exists(_testDir)) Directory.Delete(_testDir, true); } - private SimulationEngine RunSimulation(int maxTicks, float tickDt = 1f / 20f) + private SimulationEngine RunSimulation(int maxTicks, float tickDt = 1f / 20f, float timeScale = 8f) { var engine = new SimulationEngine(_scenario, _frameStore, new DamageModelRouter(), _paths, new DefaultDefensePlanner(_ammoCatalog)); engine.Initialize(_taskId); - - // 诊断:检查 _fireSchedule 的时序 - var fld = typeof(SimulationEngine).GetField("_fireSchedule", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); - if (fld != null) - { - var schedule = fld.GetValue(engine) as System.Collections.IList; - if (schedule != null && schedule.Count > 0) - { - var ftimes = schedule.Cast().Select(e => ((dynamic)e).FireTime).Cast().ToList(); - System.IO.File.WriteAllText(@"C:\Users\Tellme\Desktop\schedule_dump.txt", - $"count={schedule.Count} first={ftimes.Min():F3} last={ftimes.Max():F3} span={ftimes.Max()-ftimes.Min():F3}\n" + - string.Join("\n", ftimes.Select((t,i) => $"{t:F3}"))); - } - } - - engine.TimeScale = 8f; // 8倍速加速 + engine.TimeScale = timeScale; // 8倍速加速 for (int i = 0; i < maxTicks; i++) { var r = engine.Tick(tickDt);