use std::error::Error; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct CoreTickInput { pub world: W, pub actions: Vec, } #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct CoreTickOutput { pub world: W, } pub trait Core { type World: Serialize + DeserializeOwned; type Action: Serialize + DeserializeOwned; type Error: Error + Send + Sync + 'static; fn tick( &mut self, input: CoreTickInput, ) -> Result, Self::Error>; }