Reorganize board code in engine

Just a bit
This commit is contained in:
2021-12-20 21:16:24 +01:00
parent d80cc79f57
commit ef5719f2f5

View File

@@ -242,6 +242,11 @@ pub struct Board {
}
impl Board {
pub fn new() -> Board {
Board {
state: Default::default(),
}
}
fn get_at(&self, position: &Position) -> Option<&Piece> {
self.state.get(position)
}
@@ -260,11 +265,8 @@ impl Board {
self.set_at(target, Some(piece));
Ok(())
}
pub fn new() -> Board {
Board {
state: Default::default(),
}
pub fn clear(&mut self) {
self.state.clear();
}
pub fn reset(&mut self) {
self.state.clear();