mod simulation_impl;
pub use self::simulation_impl::*;
use crate::prelude::*;
use crate::private::Sealed;
#[cfg(any(test, feature = "use-mocks"))]
use mockiato::mockable;
use std::fmt::Debug;
#[cfg_attr(any(test, feature = "use-mocks"), mockable)]
pub trait Simulation<T>: Debug + Sealed {
fn step(&mut self);
fn add_object(
&mut self,
object_description: ObjectDescription<T>,
object_behavior: Box<dyn ObjectBehavior<T>>,
) -> Object<'_, T>;
fn objects(&self) -> Snapshot<'_, T>;
fn object(&self, id: Id) -> Option<Object<'_, T>>;
fn set_simulated_timestep(&mut self, timestep: f64);
fn objects_in_area(&self, area: Aabb) -> Snapshot<'_, T>;
fn objects_in_polygon(&self, area: &Polygon) -> Snapshot<'_, T>;
fn objects_in_ray(&self, origin: Point, direction: Vector) -> Snapshot<'_, T>;
}
pub type Id = usize;
pub type Snapshot<'a, T> = Vec<Object<'a, T>>;
#[cfg(any(test, feature = "use-mocks"))]
impl<T> Sealed for SimulationMock<'_, T> {}