diff --git a/Cargo.toml b/Cargo.toml index e38f932..dc5438f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ harness = false [dependencies] arrayvec = "0.7" bitflags = "2" -shakmaty = "0.27" +shakmaty = "0.27.2" byteorder = "1.2" rustc-hash = "2" once_cell = "1.12" diff --git a/src/material.rs b/src/material.rs index 75a029f..f00e46b 100644 --- a/src/material.rs +++ b/src/material.rs @@ -151,9 +151,9 @@ impl Material { .unwrap_or(0) } - pub(crate) fn into_flipped(self) -> Material { + pub(crate) fn into_swapped(self) -> Material { Material { - by_color: self.by_color.into_flipped(), + by_color: self.by_color.into_swapped(), } } diff --git a/src/table.rs b/src/table.rs index d191414..8d360df 100644 --- a/src/table.rs +++ b/src/table.rs @@ -904,7 +904,7 @@ impl Table { .map(|side| { let pieces = parse_pieces(&*raf, ptr, material.count(), *side)?; let key = Material::from_iter(pieces.clone()); - ensure!(key == material || key.into_flipped() == material); + ensure!(key == material || key.into_swapped() == material); GroupData::new::(pieces, order[side.fold_wb(0, 1)], file) }) .collect::>>()?; @@ -1132,7 +1132,7 @@ impl Table { fn encode(&self, pos: &S) -> ProbeResult> { let key = Material::from_board(pos.board()); let material = Material::from_iter(self.files[0].sides[0].groups.pieces.clone()); - assert!(key == material || key == material.clone().into_flipped()); + assert!(key == material || key == material.clone().into_swapped()); let symmetric_btm = material.is_symmetric() && pos.turn().is_black(); let black_stronger = key != material; diff --git a/src/tablebase.rs b/src/tablebase.rs index 952881b..ab572c0 100644 --- a/src/tablebase.rs +++ b/src/tablebase.rs @@ -219,7 +219,7 @@ impl Tablebase { if let Some((path, table)) = self .wdl .get(key) - .or_else(|| self.wdl.get(&key.clone().into_flipped())) + .or_else(|| self.wdl.get(&key.clone().into_swapped())) { table .get_or_try_init(|| WdlTable::new(self.filesystem.open(path)?, key)) @@ -236,7 +236,7 @@ impl Tablebase { if let Some((path, table)) = self .dtz .get(key) - .or_else(|| self.dtz.get(&key.clone().into_flipped())) + .or_else(|| self.dtz.get(&key.clone().into_swapped())) { table .get_or_try_init(|| DtzTable::new(self.filesystem.open(path)?, key))