Preserve the adapter facade and move adapter-only checks out of domain tests. Late tracks do not reveal an unseen launch origin or its timestamp. Co-Authored-By: Codex GPT-6.1 Terra <noreply@openai.com>
This commit is contained in:
@@ -60,6 +60,29 @@ pub struct RaidOrder {
|
||||
pub aim: Aim,
|
||||
}
|
||||
|
||||
impl RaidOrder {
|
||||
/// A combined strike of about `n`, as `/airdef wave mix n` orders it.
|
||||
pub fn mix(n: u32, dist: f64) -> RaidOrder {
|
||||
let n = n.max(4);
|
||||
let mut kinds = vec![
|
||||
(DroneKind::Gerbera, n / 4 + 1),
|
||||
(DroneKind::Shahed, n / 3 + 1),
|
||||
(DroneKind::Geran3, n / 8 + 1),
|
||||
(DroneKind::Kh101, n / 8 + 1),
|
||||
(DroneKind::Kalibr, n / 10 + 1),
|
||||
(DroneKind::Kh22, n / 16),
|
||||
(DroneKind::Zircon, n / 20),
|
||||
(DroneKind::Iskander, n / 12 + 1),
|
||||
(DroneKind::Kinzhal, n / 16),
|
||||
];
|
||||
if n >= 30 {
|
||||
kinds.push((DroneKind::Oreshnik, 1));
|
||||
}
|
||||
kinds.retain(|k| k.1 > 0);
|
||||
RaidOrder { kinds, approach: Approach::TwoSectors, dist, aim: Aim::Objects }
|
||||
}
|
||||
}
|
||||
|
||||
/// A drone of a raid being planned.
|
||||
struct Item {
|
||||
d: Drone,
|
||||
@@ -963,7 +986,7 @@ mod tests {
|
||||
serve(&mut ground, &land, sim.tick);
|
||||
sim.step(&mut ground, None, &mut out);
|
||||
}
|
||||
let mut order = crate::wave::WaveConfig::mix(36, 500.0);
|
||||
let mut order = RaidOrder::mix(36, 500.0);
|
||||
order.aim = Aim::Smart;
|
||||
order.approach = Approach::AllSides;
|
||||
let total: u32 = order.kinds.iter().map(|k| k.1).sum();
|
||||
@@ -1044,13 +1067,15 @@ mod big {
|
||||
serve(&mut ground, &land, sim.tick);
|
||||
sim.step(&mut ground, None, &mut out);
|
||||
}
|
||||
let mut w = crate::wave::WaveConfig::default();
|
||||
w.counts = [10, 12, 6, 6, 6, 6, 4, 4, 6, 4, 1];
|
||||
w.aim = Aim::Smart;
|
||||
w.approach = Approach::AllSides;
|
||||
w.dist = 800.0;
|
||||
let order = RaidOrder {
|
||||
kinds: [DroneKind::Gerbera, DroneKind::Shahed, DroneKind::Geran3, DroneKind::Lancet,
|
||||
DroneKind::Kh101, DroneKind::Kalibr, DroneKind::Kh22, DroneKind::Zircon,
|
||||
DroneKind::Iskander, DroneKind::Kinzhal, DroneKind::Oreshnik]
|
||||
.into_iter().zip([10, 12, 6, 6, 6, 6, 4, 4, 6, 4, 1]).collect(),
|
||||
aim: Aim::Smart, approach: Approach::AllSides, dist: 800.0,
|
||||
};
|
||||
let t = std::time::Instant::now();
|
||||
sim.order_raid(&w.order(), &sim.targets.clone(), &mut out);
|
||||
sim.order_raid(&order, &sim.targets.clone(), &mut out);
|
||||
let mut ticks = 0;
|
||||
let mut slowest = std::time::Duration::ZERO;
|
||||
while sim.planning() {
|
||||
|
||||
Reference in New Issue
Block a user