// SPDX-FileCopyrightText: 2024 Topola contributors // // SPDX-License-Identifier: MIT use std::ops::ControlFlow; use thiserror::Error; use crate::{ autorouter::invoker::{ GetGhosts, GetMaybeAstarStepper, GetMaybeNavcord, GetNavmeshDebugTexts, GetObstacles, }, board::AccessMesadata, drawing::graph::PrimitiveIndex, geometry::primitive::PrimitiveShape, router::{ astar::AstarStepper, navcord::Navcord, navmesh::{Navmesh, NavnodeIndex}, }, stepper::{Abort, Step}, }; use super::activity::ActivityContext; #[derive(Error, Debug, Clone)] pub enum InteractionError { #[error("nothing to interact with")] NothingToInteract, } pub enum InteractionStepper { // No interactions yet. This is only an empty skeleton for now. // Examples of interactions: // - interactively routing a track // - interactively moving a footprint. } impl Step, String> for InteractionStepper { type Error = InteractionError; fn step( &mut self, _context: &mut ActivityContext, ) -> Result, InteractionError> { Ok(ControlFlow::Break(String::from(""))) } } impl Abort> for InteractionStepper { fn abort(&mut self, _context: &mut ActivityContext) { todo!(); } } impl GetMaybeAstarStepper for InteractionStepper { fn maybe_astar(&self) -> Option<&AstarStepper> { todo!() } } impl GetMaybeNavcord for InteractionStepper { fn maybe_navcord(&self) -> Option<&Navcord> { todo!() } } impl GetGhosts for InteractionStepper { fn ghosts(&self) -> &[PrimitiveShape] { todo!() } } impl GetObstacles for InteractionStepper { fn obstacles(&self) -> &[PrimitiveIndex] { todo!() } } impl GetNavmeshDebugTexts for InteractionStepper { fn navnode_debug_text(&self, _navnode: NavnodeIndex) -> Option<&str> { todo!() } fn navedge_debug_text(&self, _navedge: (NavnodeIndex, NavnodeIndex)) -> Option<&str> { todo!() } }