#[non_exhaustive]pub struct ControllerConfig {
pub sprint: bool,
pub arrive_radius: f64,
pub stuck_ticks: u32,
pub off_path_ticks: u32,
pub work_ticks: u32,
}Expand description
Options of the Controller. Build with ControllerConfig::default and the with_*
methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sprint: boolSprint on straight runs (needs food > 6). Default on.
arrive_radius: f64The last step counts as reached within this horizontal distance of its centre. Default 0.35.
stuck_ticks: u32Ticks without getting closer to the next step before Progress::Stuck. Default 60.
off_path_ticks: u32Ticks away from the path before Progress::OffPath. Default 10.
work_ticks: u32Ticks a dig or place job may take before Progress::Stuck. Default 400.
Implementations§
Source§impl ControllerConfig
impl ControllerConfig
Sourcepub fn with_sprint(self, on: bool) -> Self
pub fn with_sprint(self, on: bool) -> Self
Sprinting on or off.
Sourcepub fn with_arrive_radius(self, blocks: f64) -> Self
pub fn with_arrive_radius(self, blocks: f64) -> Self
Arrival radius around the last step’s centre.
Sourcepub fn with_stuck_ticks(self, ticks: u32) -> Self
pub fn with_stuck_ticks(self, ticks: u32) -> Self
Ticks without progress before giving up.
Sourcepub fn with_off_path_ticks(self, ticks: u32) -> Self
pub fn with_off_path_ticks(self, ticks: u32) -> Self
Ticks off the path before giving up.
Sourcepub fn with_work_ticks(self, ticks: u32) -> Self
pub fn with_work_ticks(self, ticks: u32) -> Self
Time limit of one dig / place job.
Trait Implementations§
Source§impl Clone for ControllerConfig
impl Clone for ControllerConfig
Source§impl Debug for ControllerConfig
impl Debug for ControllerConfig
Source§impl Default for ControllerConfig
impl Default for ControllerConfig
Source§impl PartialEq for ControllerConfig
impl PartialEq for ControllerConfig
impl StructuralPartialEq for ControllerConfig
Auto Trait Implementations§
impl Forget for ControllerConfig
impl Freeze for ControllerConfig
impl Move for ControllerConfig
impl RefUnwindSafe for ControllerConfig
impl Send for ControllerConfig
impl Sync for ControllerConfig
impl Unpin for ControllerConfig
impl UnsafeUnpin for ControllerConfig
impl UnwindSafe for ControllerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more