Reorganize board code in engine
Just a bit
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user