diff --git a/src/agent.rs b/src/agent.rs index cfa197b..3a12ae3 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -3,6 +3,7 @@ use rand::prelude::*; use std::io; use std::io::prelude::*; +#[allow(dead_code)] pub trait Agent { /// Returns the move of an [`Agent`] fn next_move(&mut self, board: &Board) -> Option<(usize, usize)>; @@ -17,6 +18,14 @@ pub struct ManualAgent { color: Piece, } +impl ManualAgent { + #[allow(dead_code)] + pub const fn new(color: Piece) -> Self { + Self { color } + } +} + +#[allow(dead_code)] impl Agent for ManualAgent { fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> { let stdin = io::stdin(); @@ -57,18 +66,12 @@ impl Agent for ManualAgent { } } -impl ManualAgent { - #[allow(dead_code)] - pub const fn new(color: Piece) -> Self { - Self { color } - } -} - /// An [`Agent`] that just makes a random move that is legal pub struct RandomAgent { color: Piece, } +#[allow(dead_code)] impl Agent for RandomAgent { fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> { board.possible_moves(self.color).choose(&mut rand::rng()) diff --git a/src/complexagent.rs b/src/complexagent.rs index b0a752e..def2453 100644 --- a/src/complexagent.rs +++ b/src/complexagent.rs @@ -5,6 +5,7 @@ pub struct ComplexAgent { future_moves: FutureMoves, } +#[allow(dead_code)] impl ComplexAgent { pub const fn new(color: Piece) -> Self { const MAX_DEPTH: usize = 15; diff --git a/src/game.rs b/src/game.rs index 086b1eb..af09c38 100644 --- a/src/game.rs +++ b/src/game.rs @@ -24,6 +24,7 @@ impl std::fmt::Display for Game { } } +#[allow(dead_code)] impl Game { pub fn new(player1: Box, player2: Box) -> Self { let player1_color = player1.color();