diff --git a/src/lib/controller.rs b/src/lib/controller.rs index 5027590..f2c3698 100644 --- a/src/lib/controller.rs +++ b/src/lib/controller.rs @@ -52,3 +52,7 @@ pub trait Controller { pub mod player; pub mod random; pub mod simulated; + +pub use player::PlayerController; +pub use random::RandomController; +pub use simulated::SimulatedController; diff --git a/src/lib/controller/simulated.rs b/src/lib/controller/simulated.rs new file mode 100644 index 0000000..10d2f47 --- /dev/null +++ b/src/lib/controller/simulated.rs @@ -0,0 +1,34 @@ +use crate::lib::grid::Grid; + +use super::{Controller, ControllerError, Move}; + +pub enum Objective { + Score, + TileCount, +} + +pub struct SimulatedController { + simulations_per_move: usize, + length_of_simulation: usize, + objective: Objective, +} + +impl SimulatedController { + pub fn new( + simulations_per_move: usize, + length_of_simulation: usize, + objective: Objective, + ) -> Self { + Self { + simulations_per_move, + length_of_simulation, + objective, + } + } +} + +impl Controller for SimulatedController { + fn next_move(&mut self, grid: &Grid) -> Result { + todo!() + } +}