pub type Distance = isize; pub struct Position { pub x: Distance, pub y: Distance, } pub struct Direction { pub x: Distance, pub y: Distance, } pub type AgentId = usize; pub struct WorldView { pub self_tagged: bool, pub bounds_distance: (Distance, Distance, Distance, Distance), pub other_agents: Vec<(Direction, AgentId)>, } pub enum Move { Noop, // Why not an Option? TryTag(AgentId), TryMove(Direction), } pub trait Agent { fn next_move(&self, view: WorldView) -> Move; fn get_tagged(&mut self, by: AgentId); }