added constructor to the random controller

This commit is contained in:
JOLIMAITRE Matthieu 2022-04-04 17:32:21 +03:00
parent 4c821be1fe
commit b5a38cff72

View file

@ -5,6 +5,12 @@ use crate::lib::grid::Grid;
pub struct RandomController; pub struct RandomController;
impl RandomController {
pub fn new() -> Self {
Self
}
}
impl Controller for RandomController { impl Controller for RandomController {
fn next_move(&mut self, _grid: &Grid) -> Result<Move, ControllerError> { fn next_move(&mut self, _grid: &Grid) -> Result<Move, ControllerError> {
let movement = random(); let movement = random();