From e1f26ba007532eca4b6afe4d49aca58799c1ce05 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 23:04:26 +0400 Subject: feat(ai): dispatch scripted warbot groups Single.01 selects a free warbot for the capture problem and issues a patrol around the moving capturer from stock startup. Group recruitment uses the supported TAKE_BY_HITS branch. Priority preemption and group expression scheduling remain open. --- crates/fparkan-runtime/src/unit_patrol.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crates/fparkan-runtime/src/unit_patrol.rs') diff --git a/crates/fparkan-runtime/src/unit_patrol.rs b/crates/fparkan-runtime/src/unit_patrol.rs index c4b3b969..bc2dc3a4 100644 --- a/crates/fparkan-runtime/src/unit_patrol.rs +++ b/crates/fparkan-runtime/src/unit_patrol.rs @@ -242,6 +242,17 @@ impl UnitPatrol { self.units.iter().any(|unit| unit.handle == handle) } + pub(super) fn has_object_order(&self, handle: ObjectHandle, target: ObjectHandle) -> bool { + self.units + .iter() + .any(|unit| unit.handle == handle && unit.center_object == Some(target)) + } + + pub(super) fn clear_object_order(&mut self, handle: ObjectHandle, target: ObjectHandle) { + self.units + .retain(|unit| unit.handle != handle || unit.center_object != Some(target)); + } + pub(super) fn shut_down(&mut self, handle: ObjectHandle) -> bool { // shortcut: stop autonomous movement and fire until the native shutdown task is modeled. self.units.retain(|unit| unit.handle != handle); -- cgit v1.2.3