mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
fix: formatting
This commit is contained in:
@@ -79,6 +79,7 @@ impl Board {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// For testing
|
/// For testing
|
||||||
|
#[allow(dead_code)]
|
||||||
fn new_empty(player1: &mut Player, player2: &mut Player, size: Option<usize>) -> Self {
|
fn new_empty(player1: &mut Player, player2: &mut Player, size: Option<usize>) -> Self {
|
||||||
debug!("Creating new empty board!");
|
debug!("Creating new empty board!");
|
||||||
let size = size.unwrap_or(8);
|
let size = size.unwrap_or(8);
|
||||||
@@ -104,6 +105,7 @@ impl Board {
|
|||||||
Board { board, size }
|
Board { board, size }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
fn place_pawn(&mut self, target: Position, owner: &Player) {
|
fn place_pawn(&mut self, target: Position, owner: &Player) {
|
||||||
debug!("Placing new pawn by hand!");
|
debug!("Placing new pawn by hand!");
|
||||||
self[target].pawn = Some(Pawn::new(owner));
|
self[target].pawn = Some(Pawn::new(owner));
|
||||||
@@ -131,6 +133,7 @@ impl Board {
|
|||||||
pos.is_in_range(self.size) && self[pos].pawn.is_none()
|
pos.is_in_range(self.size) && self[pos].pawn.is_none()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
fn is_pawn_movable(&self, pos: Position, player: &Player) -> bool {
|
fn is_pawn_movable(&self, pos: Position, player: &Player) -> bool {
|
||||||
self.get_available_moves(pos, player)
|
self.get_available_moves(pos, player)
|
||||||
.is_some_and(|moves| !moves.is_empty())
|
.is_some_and(|moves| !moves.is_empty())
|
||||||
|
|||||||
@@ -47,10 +47,6 @@ impl GuiFieldVec {
|
|||||||
pub fn clear(&mut self) {
|
pub fn clear(&mut self) {
|
||||||
self.gui_fields.clear();
|
self.gui_fields.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn size(&self) -> usize {
|
|
||||||
self.gui_fields.len()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> IntoIterator for &'a GuiFieldVec {
|
impl<'a> IntoIterator for &'a GuiFieldVec {
|
||||||
|
|||||||
Reference in New Issue
Block a user