use std::fmt::Debug;
use std::ops::IndexMut;
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum ThreePedals {
Pedal1,
Pedal2,
Pedal3,
}
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum SixPedals {
Pedal1,
Pedal2,
Pedal3,
Pedal4,
Pedal5,
Pedal6,
}
pub(crate) trait Pedals: Sized + Copy + Debug {
type STATES: Default + IndexMut<usize, Output = bool>;
fn variants<'a>() -> &'a [Self];
}
impl Pedals for ThreePedals {
type STATES = [bool; 3];
fn variants<'a>() -> &'a [Self] {
use ThreePedals::*;
&[Pedal1, Pedal2, Pedal3]
}
}
impl Pedals for SixPedals {
type STATES = [bool; 6];
fn variants<'a>() -> &'a [Self] {
use SixPedals::*;
&[Pedal1, Pedal2, Pedal3, Pedal4, Pedal5, Pedal6]
}
}