namespace XFEEDToolBox.Core.Galaxy; /// Coverage evidence from one bounded Stellar Forge query, separate from its returned rows. public sealed record GalaxyRegionResult(IReadOnlyList Systems, int MinimumMassCode = -1, int ProcessedCells = -1, int TotalCells = -1, bool Truncated = false, bool Complete = false, int FailedCells = 0) { public string Error { get; init; }=""; public string Scope { get; init; }=""; public int RequestedCells { get; init; }=-1; public XFEEDToolBox.Core.Models.Coordinates? Origin { get; init; } public const int NativeRowLimit = 24000; public const int NativeSingleCellRowLimit = 131072; public int RowLimit {get;init;}=NativeRowLimit; public bool WithinReturnedRowBudget=>RowLimit==NativeRowLimit?Systems.Count MinimumMassCode >= 0 && ProcessedCells >= 0 && TotalCells >= 0; public bool IsFullyCovered => Scope!="requested-cells" && Complete && Error.Length==0 && !Truncated && Systems.Count < NativeRowLimit && MinimumMassCode == 0 && FailedCells == 0 && ProcessedCells == TotalCells && TotalCells > 0; public bool AreRequestedCellsCovered=>Scope=="requested-cells"&&RequestedCells>0&&RequestedCells==TotalCells&& Complete&&Error.Length==0&&!Truncated&&WithinReturnedRowBudget&&FailedCells==0&&ProcessedCells==TotalCells; public bool NeedsSubdivision => Truncated || !WithinReturnedRowBudget || Scope!="requested-cells"&&MinimumMassCode > 0 || FailedCells > 0 || Error.Length > 0 || ProcessedCells >= 0 && TotalCells >= 0 && ProcessedCells < TotalCells; public static GalaxyRegionResult Covered(IReadOnlyList systems) => new(systems, 0, 1, 1, false, true); } /// Actual append-only native rows received before the bounded region job has finished. public sealed record GalaxyNativeRegionProgress(long Generation, XFEEDToolBox.Core.Models.Coordinates Centre, double Radius, IReadOnlyList Systems, GalaxyRegionResult Coverage, bool Done, int TotalAvailable, int DownloadedCount);