/// <summary> /// Checks if an <see cref="ISpatial"/> is close enough to another <see cref="ISpatial"/> to pick it up. /// </summary> /// <param name="grabber">The <see cref="ISpatial"/> doing the picking up.</param> /// <param name="toGrab">The <see cref="ISpatial"/> being picked up.</param> /// <returns>True if the <paramref name="grabber"/> is close enough to the <paramref name="toGrab"/> /// to pick it up; otherwise false.</returns> public static bool IsValidPickupDistance(ISpatial grabber, ISpatial toGrab) { var region = GetPickupArea(grabber); return(toGrab.Intersects(region)); }
/// <summary> /// Gets if the <paramref name="shopper"/> is close enough to the <paramref name="shopOwner"/> to shop. /// </summary> /// <param name="shopper">The <see cref="Entity"/> doing the shopping.</param> /// <param name="shopOwner">The <see cref="Entity"/> that owns the shop.</param> /// <returns>True if the <paramref name="shopper"/> is close enough to the <paramref name="shopOwner"/> to /// shop; otherwise false.</returns> public static bool IsValidDistanceToShop(ISpatial shopper, ISpatial shopOwner) { var area = GetValidShopArea(shopper); return(shopOwner.Intersects(area)); }
/// <summary> /// Checks if an <see cref="ISpatial"/> is close enough to another <see cref="ISpatial"/> to pick it up. /// </summary> /// <param name="grabber">The <see cref="ISpatial"/> doing the picking up.</param> /// <param name="toGrab">The <see cref="ISpatial"/> being picked up.</param> /// <returns>True if the <paramref name="grabber"/> is close enough to the <paramref name="toGrab"/> /// to pick it up; otherwise false.</returns> public static bool IsValidPickupDistance(ISpatial grabber, ISpatial toGrab) { var region = GetPickupArea(grabber); return toGrab.Intersects(region); }
/// <summary> /// Gets if the <paramref name="shopper"/> is close enough to the <paramref name="shopOwner"/> to shop. /// </summary> /// <param name="shopper">The <see cref="Entity"/> doing the shopping.</param> /// <param name="shopOwner">The <see cref="Entity"/> that owns the shop.</param> /// <returns>True if the <paramref name="shopper"/> is close enough to the <paramref name="shopOwner"/> to /// shop; otherwise false.</returns> public static bool IsValidDistanceToShop(ISpatial shopper, ISpatial shopOwner) { var area = GetValidShopArea(shopper); return shopOwner.Intersects(area); }
/// <summary> /// Checks if the <paramref name="spatial"/> is standing on this <see cref="WallEntityBase"/>. /// </summary> /// <param name="spatial">The <see cref="ISpatial"/> to check if standing on this <see cref="WallEntityBase"/>.</param> /// <returns>True if the <paramref name="spatial"/> is standing on this <see cref="WallEntityBase"/>; otherwise false.</returns> public static bool IsEntityStandingOn(ISpatial wall, ISpatial spatial) { var rect = spatial.GetStandingAreaRect(); return wall.Intersects(rect); }
/// <summary> /// Checks if the <paramref name="spatial"/> is standing on this <see cref="WallEntityBase"/>. /// </summary> /// <param name="spatial">The <see cref="ISpatial"/> to check if standing on this <see cref="WallEntityBase"/>.</param> /// <returns>True if the <paramref name="spatial"/> is standing on this <see cref="WallEntityBase"/>; otherwise false.</returns> public static bool IsEntityStandingOn(ISpatial wall, ISpatial spatial) { var rect = spatial.GetStandingAreaRect(); return(wall.Intersects(rect)); }