public static IInteractable collisionWithInteractableAtRelative(IInteractable p_interactable, Point p_offset, IInteractable p_exclude)
{
IInteractable l_collidedObject = null;
foreach (IInteractable i in WorldManager.m_currentRoom.Interactables)
{
if (i == p_exclude || m_excluded.Contains(i))
{
continue;
}
Rectangle l_copy = p_interactable.getBoundingRect(); //preserve this just in case
Rectangle l_spriteBounds;
l_spriteBounds.X = l_copy.X + p_offset.X;
l_spriteBounds.Y = l_copy.Y + p_offset.Y;
l_spriteBounds.Width = l_copy.Width;
l_spriteBounds.Height = l_copy.Height;
Rectangle l_charBounds = i.getBoundingRect();
if (l_spriteBounds.Intersects(l_charBounds))
{
l_collidedObject = i;
break;
}
}
return l_collidedObject;
}