public static CollisionBoxComponent CheckForSpecificCollision(CollisionBoxComponent entity, short collisionID, CollisionBoxComponent ignore)
        {
            foreach (CollisionBoxComponent colBox in collisionLists[collisionID])
            {
                if (entity.Intersects(colBox) && colBox != ignore && colBox != entity)
                    return colBox;
            }

            return null;
        }
        public static CollisionBoxComponent CheckForCollision(CollisionBoxComponent entity, CollisionBoxComponent ignore)
        {
            foreach (short colType in entity.CollisionType.CollidingIDs)
            {
                CollisionBoxComponent colbox = CheckForSpecificCollision(entity, colType, ignore);
                if (colbox != null)
                    return colbox;
            }

            return null;
        }
 /// <summary>
 /// Check to see whether the object intersects another
 /// </summary>
 public bool Intersects(CollisionBoxComponent value)
 {
     Vector2[] itsCorners = value.BoundingCorners;
     Vector2[] myCorners = BoundingCorners;
     for (int i = 0; i < 4; i++)
     {
         if (PointIsInBoundingBox(itsCorners[i]))
             return true;
         if (value.PointIsInBoundingBox(myCorners[i]))
             return true;
     }
     return false;
 }
        /// <summary>
        /// Clone object
        /// </summary>
        public object Clone()
        {
            CollisionBoxComponent clone = new CollisionBoxComponent();

            clone.connectedGameObject = connectedGameObject;
            clone.Position = Position;
            clone.Rotation = Rotation;
            clone.Scale = Scale;
            clone.Origin = origin;
            clone.Width = Width;
            clone.Height = Height;

            return clone;
        }
        /// <summary>
        /// Retrives are drawable rectangle from the bounds of the collision box with scaling applied
        /// </summary>
        /// <param name="entity"></param>
        /// <returns>Rectangle</returns>
        public static Rectangle CollisionEntityToRectScaled(CollisionBoxComponent entity)
        {
            Rectangle rect = new Rectangle();
            rect.X = (int)entity.Position.X;
            rect.Y = (int)entity.Position.Y;
            rect.Width = (int)(entity.Width * entity.Scale);
            rect.Height = (int)(entity.Height * entity.Scale);

            return rect;
        }
 public static CollisionBoxComponent CheckForSpecificCollision(CollisionBoxComponent entity, short collisionID)
 {
     return CheckForSpecificCollision(entity, collisionID, null);
 }
 public static CollisionBoxComponent CheckForCollision(CollisionBoxComponent entity)
 {
     return CheckForCollision(entity, null);
 }