use std::time::Duration; #[derive(Debug, Clone, Copy, PartialEq)] pub struct Clock { pub time: [Duration; 2], // White, Black pub increment: [Duration; 2], } impl Default for Clock { fn default() -> Self { Self::new(Duration::from_secs(60 * 5), Duration::from_secs(3)) } } impl Clock { pub fn new(time: Duration, increment: Duration) -> Self { Self { time: [time, time], increment: [increment, increment], } } }