using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Physics2D.Abstract;
///
/// Represents a 2D collider.
///
public interface ICollider2D : IBehaviour, IAssignableTransform
{
///
/// Event triggered when a collision is detected.
///
event OnCollisionDetectedEventHandler? OnCollisionDetected;
///
/// Event triggered when a collision is resolved.
///
event OnCollisionResolvedEventHandler? OnCollisionResolved;
///
/// Event triggered when another triggers this .
///
event OnTriggeredEventHandler? OnTriggered;
///
/// The associated with the .
///
IRigidBody2D? RigidBody2D { get; }
///
/// The value indicating whether the is a trigger.
///
bool IsTrigger { get; set; }
///
/// Recalculates properties.
///
void Recalculate();
void Detect(CollisionDetectionInformation collisionDetectionInformation);
void Resolve(CollisionDetectionInformation collisionDetectionInformation);
void Trigger(ICollider2D initiator);
delegate void OnCollisionDetectedEventHandler(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation);
delegate void OnCollisionResolvedEventHandler(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation);
delegate void OnTriggeredEventHandler(ICollider2D sender, ICollider2D initiatorCollider);
}