package mock.model.collider; import mock.model.MockBoat; /** * Interface for all objects sensitive to collision in a race. */ public interface Collider { /** * Indicates whether a ray cast from a boat to a target collider is within the specified length. * @param boat potentially colliding with target * @param distance distance for valid collision * @return whether or not a collision has occurred */ boolean rayCast(MockBoat boat, double distance); /** * Indicates whether a ray cast from a boat to a target collider triggers a collision. Distance is set by the object. * @param boat potentially colliding with target * @return whether or not a collision has occurred */ boolean rayCast(MockBoat boat); /** * Handle a collision event * @param e details of collision */ void onCollisionEnter(Collision e); }