Move const usage out of Shared

This commit is contained in:
2022-09-14 22:32:37 -07:00
parent ad28ab2d38
commit 409c020426
28 changed files with 190 additions and 160 deletions

@ -3,7 +3,7 @@ namespace View_by_Distance.Shared.Models.Stateless.Methods;
internal abstract class Sorting
{
internal static Models.Sorting Get(Models.FaceDistance faceDistanceEncoding, Models.FaceDistance faceDistanceLength, bool anyLowerThanTolerance, List<(long lcl, long minimum, long maximum, long ucl)> personKeysRangesCollection)
internal static Models.Sorting Get(int faceDistancePermyriad, double faceDistanceTolerance, Models.FaceDistance faceDistanceEncoding, Models.FaceDistance faceDistanceLength, bool anyLowerThanTolerance, List<(long lcl, long minimum, long maximum, long ucl)> personKeysRangesCollection)
{
Models.Sorting result;
if (faceDistanceLength.Length is null)
@ -14,7 +14,7 @@ internal abstract class Sorting
int daysDelta;
int withinRange;
int distancePermyriad;
if (faceDistanceLength.Length.Value == 0 || (anyLowerThanTolerance && faceDistanceLength.Length.Value >= Stateless.IFaceDistance.Tolerance))
if (faceDistanceLength.Length.Value == 0 || (anyLowerThanTolerance && faceDistanceLength.Length.Value >= faceDistanceTolerance))
{
older = false;
daysDelta = 0;
@ -30,7 +30,7 @@ internal abstract class Sorting
TimeSpan timeSpan = new(faceDistanceLength.MinimumDateTime.Value.Ticks - ticks);
older = timeSpan.TotalMilliseconds < 0;
daysDelta = (int)Math.Round(Math.Abs(timeSpan.TotalDays), 0);
distancePermyriad = (int)(faceDistanceLength.Length.Value / Stateless.IFaceDistance.Tolerance * Stateless.IFaceDistance.Permyriad);
distancePermyriad = (int)(faceDistanceLength.Length.Value / faceDistanceTolerance * faceDistancePermyriad);
foreach ((long lcl, long minimum, long maximum, long ucl) in personKeysRangesCollection)
{
if (ticks > minimum && ticks < maximum)