From 652ea97f8310f1c83b390741875e542eca2192ca Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 28 Jan 2025 16:16:20 -0500 Subject: [PATCH] remove QueueAgent --- src/agent.rs | 29 ----------------------------- src/main.rs | 9 --------- 2 files changed, 38 deletions(-) diff --git a/src/agent.rs b/src/agent.rs index de059c6..44155cf 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -1,5 +1,4 @@ use crate::{board::Board, piece::Piece}; -use std::collections::VecDeque; pub trait Agent { fn next_move(&mut self, board: &Board) -> Option<(usize, usize)>; @@ -24,31 +23,3 @@ impl Agent for ManualAgent { self.color } } - -pub struct QueueAgent { - moves: VecDeque<(usize, usize)>, - color: Piece, -} - -impl QueueAgent { - pub fn new(moves: impl IntoIterator, color: Piece) -> Self { - Self { - moves: moves.into_iter().collect(), - color, - } - } -} - -impl Agent for QueueAgent { - fn next_move(&mut self, _: &Board) -> Option<(usize, usize)> { - self.moves.pop_front() - } - - fn name(&self) -> &'static str { - "Queue Agent" - } - - fn color(&self) -> Piece { - self.color - } -} diff --git a/src/main.rs b/src/main.rs index 48a3910..74679f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,15 +10,6 @@ mod misc; mod piece; fn main() { - // let player1 = QueueAgent::new( - // [(0, 0), (1, 0), (1, 2), (3, 2), (3, 0), (3, 4), (0, 1)], - // Piece::Black, - // ); - // let player2 = QueueAgent::new( - // [(1, 1), (2, 2), (3, 3), (3, 1), (0, 2), (4, 2), (3, 5)], - // Piece::White, - // ); - let player1 = ComplexAgent::new(Piece::Black); let player2 = ComplexAgent::new(Piece::White); let mut game = Game::new(Box::new(player1), Box::new(player2));