refactor(router/astar): Rename `Astar<...>` to `AstarStepper<...>`

Since it is a stepper, and we append -`Stepper` to identifiers denoting
types that are steppers.
This commit is contained in:
Mikolaj Wielgus 2025-05-12 02:28:34 +02:00
parent 0df68ee80c
commit 7dc275969c
2 changed files with 6 additions and 6 deletions

View File

@ -117,7 +117,7 @@ pub trait MakeEdgeRef: IntoEdgeReferences {
fn edge_ref(&self, edge_id: Self::EdgeId) -> Self::EdgeRef; fn edge_ref(&self, edge_id: Self::EdgeId) -> Self::EdgeRef;
} }
pub struct Astar<G, K> pub struct AstarStepper<G, K>
where where
G: GraphBase, G: GraphBase,
G::NodeId: Eq + Ord, G::NodeId: Eq + Ord,
@ -149,7 +149,7 @@ pub enum AstarError {
NotFound, NotFound,
} }
impl<G, K> Astar<G, K> impl<G, K> AstarStepper<G, K>
where where
G: GraphBase, G: GraphBase,
G::NodeId: Eq + Ord, G::NodeId: Eq + Ord,
@ -177,7 +177,7 @@ where
} }
impl<G, K, R, S: AstarStrategy<G, K, R>> Step<S, (K, Vec<G::NodeId>, R), AstarContinueStatus> impl<G, K, R, S: AstarStrategy<G, K, R>> Step<S, (K, Vec<G::NodeId>, R), AstarContinueStatus>
for Astar<G, K> for AstarStepper<G, K>
where where
G: GraphBase, G: GraphBase,
G::NodeId: Eq + Ord, G::NodeId: Eq + Ord,

View File

@ -13,7 +13,7 @@ use crate::{
geometry::primitive::PrimitiveShape, geometry::primitive::PrimitiveShape,
layout::LayoutEdit, layout::LayoutEdit,
router::{ router::{
astar::{Astar, AstarError}, astar::{AstarError, AstarStepper},
navcord::Navcord, navcord::Navcord,
navcorder::Navcorder, navcorder::Navcorder,
navmesh::{Navmesh, NavmeshError}, navmesh::{Navmesh, NavmeshError},
@ -25,7 +25,7 @@ use crate::{
#[derive(Getters, Dissolve)] #[derive(Getters, Dissolve)]
pub struct RouteStepper { pub struct RouteStepper {
#[getter(skip)] #[getter(skip)]
astar: Astar<Navmesh, f64>, astar: AstarStepper<Navmesh, f64>,
navcord: Navcord, navcord: Navcord,
ghosts: Vec<PrimitiveShape>, ghosts: Vec<PrimitiveShape>,
obstacles: Vec<PrimitiveIndex>, obstacles: Vec<PrimitiveIndex>,
@ -57,7 +57,7 @@ impl RouteStepper {
let mut navcord = layout.start(recorder, source, source_navvertex, width); let mut navcord = layout.start(recorder, source, source_navvertex, width);
let mut strategy = RouterAstarStrategy::new(layout, &mut navcord, target); let mut strategy = RouterAstarStrategy::new(layout, &mut navcord, target);
let astar = Astar::new(navmesh, source_navvertex, &mut strategy); let astar = AstarStepper::new(navmesh, source_navvertex, &mut strategy);
let ghosts = vec![]; let ghosts = vec![];
let obstacles = vec![]; let obstacles = vec![];