#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
#[derive(Default)]
pub enum Hand {
#[default]
Unknown,
Left,
Right,
Bilateral,
}
#[derive(Debug)]
pub struct PositionalConfig<const ROW: usize, const COL: usize> {
pub hand: [[Hand; COL]; ROW],
}
impl<const ROW: usize, const COL: usize> Default for PositionalConfig<ROW, COL> {
fn default() -> Self {
Self {
hand: [[Hand::default(); COL]; ROW],
}
}
}
impl<const ROW: usize, const COL: usize> PositionalConfig<ROW, COL> {
pub fn new(hand: [[Hand; COL]; ROW]) -> Self {
Self { hand }
}
}
impl Hand {
pub fn is_same_side(self, other: Hand) -> bool {
matches!((self, other), (Hand::Left, Hand::Left) | (Hand::Right, Hand::Right))
}
}