/// <summary> /// Is there a collision between the two elements ? /// </summary> /// <param name="e2"></param> /// <returns></returns> public virtual bool Collide(Hitbox h2) { if (h2.GetType() == typeof(CircleHitbox) || h2.GetType() == typeof(PositionedCircleHitbox) ) { return Collide(((CircleHitbox)h2).Circle); } else if (h2.GetType() == typeof(SquareHitbox)) { return Collide(((SquareHitbox)h2).Square); } return false; }
/// <summary> /// Is there a collision between the two elements ? /// </summary> /// <param name="e2"></param> /// <returns></returns> public virtual bool Collide(Hitbox h2) { if (h2.GetType() == typeof(CircleHitbox) || h2.GetType() == typeof(PositionedCircleHitbox)) { return(Collide(((CircleHitbox)h2).Circle)); } else if (h2.GetType() == typeof(SquareHitbox)) { return(Collide(((SquareHitbox)h2).Square)); } return(false); }