use super::*;
pub trait UnitStep: Unit {
fn step_down(&self) -> Option<Self>;
fn step_up(&self) -> Option<Self>;
fn step_to_bottom(&self) -> Self {
let mut unit = *self;
while let Some(next) = unit.step_down() { unit = next; }
unit
}
fn step_to_top(&self) -> Self {
let mut unit = *self;
while let Some(next) = unit.step_up() { unit = next; }
unit
}
}