diff --git a/src/mappings.rs b/src/mappings.rs index b48347c..30708f6 100644 --- a/src/mappings.rs +++ b/src/mappings.rs @@ -130,27 +130,36 @@ pub struct StrideMapping { impl StrideMapping { pub fn new() -> Self { - /*let stride_json = vec!( - (0, 0, 17), - (1, 0, 17), - (2, 0, 17), - (3, 0, 17), - (4, 0, 16), - (5, 0, 17), - (6, 0, 17), - (7, 0, 17), - (8, 0, 17), - (9, 0, 17), - (10, 0, 17), - (11, 0, 17), - (12, 0, 18), - (13, 0, 17), - (14, 0, 18), - (15, 0, 17), - (16, 0, 17), - (17, 0, 17) - );*/ - let stride_json = vec!( + Self::from_json(vec!( + (0, 0, 255, false) + )) + } + + pub fn new_jar() -> Self { + Self::from_json(vec!( + (0, 0, 17, false), + (1, 0, 17, false), + (2, 0, 17, false), + (3, 0, 17, false), + (4, 0, 16, false), + (5, 0, 17, false), + (6, 0, 17, false), + (7, 0, 17, false), + (8, 0, 17, false), + (9, 0, 17, false), + (10, 0, 17, false), + (11, 0, 17, false), + (12, 0, 18, false), + (13, 0, 17, false), + (14, 0, 18, false), + (15, 0, 17, false), + (16, 0, 17, false), + (17, 0, 17, false) + )) + } + + pub fn new_panel() -> Self { + Self::from_json(vec!( (0, 0, 16, false), (1, 0, 16, true), (2, 0, 16, false), @@ -167,7 +176,10 @@ impl StrideMapping { (13, 0, 16, true), (14, 0, 16, false), (15, 0, 16, true), - ); + )) + } + + pub fn from_json(stride_json: Vec<(u8, u8, u8, bool)>) -> Self { let mut strides = [Stride::default(); STRIDE_NUM]; let stride_count = stride_json.len(); let mut physical_idx = 0;