This commit is contained in:
2025-02-26 19:50:40 -05:00
parent cd0ac5f538
commit bbeb1b8b37
5 changed files with 12 additions and 13 deletions

View File

@@ -263,14 +263,16 @@ impl FutureMoves {
/// Returns a boolean, `true` if the operation was successful, false if not
#[must_use = "You must check if the root was properly set"]
pub fn update_root_coord(&mut self, i: usize, j: usize) -> bool {
// check to make sure current_root is some so we dont
// have to do that in the iterator
if self.current_root.is_none() {
return false;
}
self.arena
.iter()
.enumerate()
.find(|(_, node)| {
node.parent == self.current_root
&& self.current_root.is_some()
&& node.coords() == (i, j)
})
.find(|(_, node)| node.parent == self.current_root && node.coords() == (i, j))
.map(|x| x.0)
// do raw set so we can prune it on the next move (in `update`)
.inspect(|&root| self.update_root_idx_raw(root))

View File

@@ -54,7 +54,6 @@ impl Move {
self_value: 0,
};
m.self_value = m.compute_self_value(agent_color);
m.value = Some(m.self_value as i128);
m
}