Implement the first full radar-profile slice (#134)
Give the separate radar three real profiles over SamKind::Radar and the typed catalog variants: - radar_search: coarse, slow, long-range search plots; no fire authority. - radar_height: raised mast, local refinement of low plots; no fire authority. - radar_track: local search, fast revisit, two refined/fire channels. - radar_multi remains the compatible universal profile, not best everywhere. Tracks now carry the measuring station, product (search/refine/fire), and quality (separate from identification), and keep the station's own plot when a fresher network relay replaces the published position. A relay never refreshes the measurement or authorizes a launch. Ordinary launches need the battery's own confirmed fire plot; launcher-only batteries use a supporting radar's own plot, and the existing heavy far shot keeps its cue-radar exception. Per-tick refinement/fire work is bounded by profile channels and local search radius. Off, damage, network and save/replay behavior are preserved: new saves write the stable profile ID, old role-only lines migrate, and embedded SAM radars keep their own fire authority. The deploy menu, status lines, map, monitor, radar scope and /airdef why explain the profile, source, age, quality, channels and refusal reason. Models/textures are untouched: all profiles reuse the existing radar silhouette (the separate art zone remains for its owner). Tests: profile single/pair/full scenarios and duplicate station, channels, relay source/age/quality, Off/damage, save migration, replay, embedded and Multifunction radars, catalog/generator checks, airdef-mod suites, core lib (non-balance on one thread; the four active balance tests in release) and core scenarios. Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
@@ -1099,6 +1099,19 @@ mod tests {
|
||||
assert!(r.sam_tracks[0].ghost(r.origin, 0.0, 1).unwrap().radar_on);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn replay_preserves_a_separate_radars_profile() {
|
||||
let mut r = recording();
|
||||
for (at, role) in [(0, battery::RadarRole::Search), (10, battery::RadarRole::Height), (20, battery::RadarRole::Engagement)] {
|
||||
let mut sam = Sam::new(1, SamKind::Radar, DVec3::ZERO, 0.0);
|
||||
sam.set_radar_role(role);
|
||||
r.note_sams(&[sam], at);
|
||||
}
|
||||
assert_eq!(r.sam_tracks[0].ghost(r.origin, 1.0, 1).unwrap().radar_profile().id, "radar_search");
|
||||
assert_eq!(r.sam_tracks[0].ghost(r.origin, 11.0, 1).unwrap().radar_profile().id, "radar_height");
|
||||
assert_eq!(r.sam_tracks[0].ghost(r.origin, 21.0, 1).unwrap().radar_profile().id, "radar_track");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn replay_preserves_launcher_configuration_and_individual_cover_poses() {
|
||||
let mut r = recording();
|
||||
@@ -1290,7 +1303,22 @@ mod tests {
|
||||
let id = sim.id();
|
||||
sim.sams.push(Sam::new(id, SamKind::Patriot, DVec3::ZERO, 0.0));
|
||||
let mut r = Recording::new(1, &sim);
|
||||
let tr = sight::Track { id: 77, class: ClassEst::Firm(Class::Drone), pos: DVec3::Z * 100.0, vel: -DVec3::Z, tick: 1, own_tick: 1, ttl: 10, hits: 1, locked: false };
|
||||
let tr = sight::Track {
|
||||
id: 77,
|
||||
class: ClassEst::Firm(Class::Drone),
|
||||
pos: DVec3::Z * 100.0,
|
||||
vel: -DVec3::Z,
|
||||
tick: 1,
|
||||
own_tick: 1,
|
||||
source: 1,
|
||||
product: battery::Measure::Fire,
|
||||
quality: 80,
|
||||
own_product: battery::Measure::Fire,
|
||||
own_quality: 80,
|
||||
ttl: 10,
|
||||
hits: 1,
|
||||
locked: false,
|
||||
};
|
||||
sim.sams[0].tracks.push(tr);
|
||||
r.note_tracks(&sim.sams);
|
||||
r.len = 1;
|
||||
@@ -1356,7 +1384,22 @@ mod tests {
|
||||
let id = sim.id();
|
||||
let mut sam = Sam::new(id, SamKind::Patriot, DVec3::ZERO, 0.0);
|
||||
for target in 1..=4 {
|
||||
sam.tracks.push(sight::Track { id: target, class: ClassEst::Firm(Class::Drone), pos: DVec3::Z, vel: DVec3::ZERO, tick: 1, own_tick: 1, ttl: 1, hits: 1, locked: false });
|
||||
sam.tracks.push(sight::Track {
|
||||
id: target,
|
||||
class: ClassEst::Firm(Class::Drone),
|
||||
pos: DVec3::Z,
|
||||
vel: DVec3::ZERO,
|
||||
tick: 1,
|
||||
own_tick: 1,
|
||||
source: sam.id,
|
||||
product: battery::Measure::Fire,
|
||||
quality: 80,
|
||||
own_product: battery::Measure::Fire,
|
||||
own_quality: 80,
|
||||
ttl: 1,
|
||||
hits: 1,
|
||||
locked: false,
|
||||
});
|
||||
}
|
||||
sim.sams.push(sam);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user