remove QueueAgent

This commit is contained in:
Simon Gardling 2025-01-28 16:16:20 -05:00
parent 78ce4d4973
commit 652ea97f83
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 0 additions and 38 deletions

View File

@ -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<Item = (usize, usize)>, 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
}
}

View File

@ -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));