add comments
This commit is contained in:
@@ -4,11 +4,15 @@ use std::io;
|
||||
use std::io::prelude::*;
|
||||
|
||||
pub trait Agent {
|
||||
/// Returns the move of an [`Agent`]
|
||||
fn next_move(&mut self, board: &Board) -> Option<(usize, usize)>;
|
||||
/// Returns the name of the [`Agent`]
|
||||
fn name(&self) -> &'static str;
|
||||
/// Returns the color the [`Agent`] is playing
|
||||
fn color(&self) -> Piece;
|
||||
}
|
||||
|
||||
/// An [`Agent`] which a user controls
|
||||
pub struct ManualAgent {
|
||||
color: Piece,
|
||||
}
|
||||
@@ -60,6 +64,7 @@ impl ManualAgent {
|
||||
}
|
||||
}
|
||||
|
||||
/// An [`Agent`] that just makes a random move that is legal
|
||||
pub struct RandomAgent {
|
||||
color: Piece,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user