Files
aa/Shared/Models/Stateless/Location.cs
Mike Phares 05fb8685d9 Removed Rectangle from LocationContainer
mapped-ids-then-whole-percentages-to-location-container

save-extracted-face

save-extracted-java-script-object-notation
2025-07-06 10:45:59 -07:00

48 lines
1.3 KiB
C#

namespace View_by_Distance.Shared.Models.Stateless;
internal abstract class Location
{
internal static bool Check(int bottom, int left, int right, int top, int zCount, bool throwException)
{
bool result = true;
if (left < 0)
result = false;
if (right < 0)
result = false;
if (right < left)
result = false;
if (top < 0)
result = false;
if (bottom < 0)
result = false;
if (bottom < top)
result = false;
if (zCount < 0)
result = false;
if (throwException && !result)
throw new Exception();
return result;
}
internal static bool Check(int bottom, int height, int left, int right, int top, int width, int zCount, bool throwException)
{
bool result = true;
if (bottom > height)
result = false;
if (left > width)
result = false;
if (right > width)
result = false;
if (top > height)
result = false;
if (zCount < 0)
result = false;
if (result)
result = Check(bottom, left, right, top, zCount, throwException);
if (throwException && !result)
throw new Exception();
return result;
}
}