1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use crate::Direction;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Finger {
pub hand: Hand,
pub kind: FingerKind,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Hand {
Left,
Right,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum FingerKind {
Thumb,
Index,
Middle,
Ring,
Pinky,
}
impl Finger {
pub fn new(hand: Hand, kind: FingerKind) -> Finger {
Finger { hand, kind }
}
pub fn dir_to(self, f: Finger) -> Direction {
Direction::from(self, f)
}
}