//! Rectangles collision detection
use crate::geometry::{Rectangle, Vector};
mod bb_collider;
pub use bb_collider::BoundingBoxCollider;
/// Struct implementing this trait can detect rectangles collisions.
pub trait CollisionStrategy {
/// Does the given rectangle at the given position collide with an already added rectangle?
fn collides(&self, pos: Vector, r: &Rectangle) -> bool;
/// Add the given rectangle at the given position to the list of rectangles to detect collisions with.
fn add(&mut self, pos: Vector, r: Rectangle);
}