XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
using XFEEDToolBox.Core.Galaxy;

namespace XFEEDToolBox.Controls;

public sealed partial class GalaxyMapView
{
    internal bool OriginalMilkyWayLoadPendingForProbe=>graphics?.PendingOriginalMilkyWay==true;
    internal bool OriginalMilkyWayReadyForProbe=>graphics?.OriginalMilkyWayReady==true;
    internal int OriginalMilkyWayInstancesForProbe=>graphics?.OriginalMilkyWayInstances??0;
    internal int OriginalGridSubmittedForProbe=>graphics?.SubmittedOriginalGridLines??0;
    internal bool OriginalGridWorldWidthForProbe=>graphics?.OriginalGridWorldWidthRestored==true;
    internal bool OriginalCoreReadyForProbe=>graphics?.OriginalCoreReady==true;
    internal bool OriginalBackgroundHdrDrawnForProbe=>graphics?.OriginalBackgroundHdrDrawn==true;
    internal bool OriginalSceneHdrDrawnForProbe=>graphics?.OriginalSceneHdrDrawn==true;
    internal string OriginalExposureStateForProbe=>graphics?.OriginalExposureState.ToString()??"Unavailable";
    internal float? OriginalType2ExposureForProbe=>graphics?.OriginalManualExposureResult?.Type2EmissiveRescaling;
    internal bool PowerActivityRingUsesToolExposureForProbe=>graphics?.PowerActivityRingUsesToolManualExposure==true;
    internal int OriginalExposureDispatchesForProbe=>graphics?.OriginalExposureDispatches??0;
    internal int OriginalBlackHolesDrawnForProbe=>graphics?.OriginalBlackHolesDrawn??0;
    internal bool OriginalPlaneReadyForProbe=>graphics?.OriginalPlaneReady==true;
    internal void SetOriginalPlaneEnabledForProbe(bool value)
    {if(graphics is not null)graphics.OriginalPlaneEnabled=value;Invalidate();}
    // Observes the classified world-size path without changing the renderer.
    // Power territory's separate distance scale is deliberately excluded.
    internal object ClassifiedSizingForProbe()
    {
        var camera=Camera;
        var extents=ordered.Select(s=>(Sample:s,Point:camera.ProjectForCatalogue(s.System.Position)))
            .Where(s=>s.Point.IsVisible)
            .Select(s=>(double)StellarAppearance.OriginalProjectedHalfExtent(s.Sample.RelativeSize,s.Point.Scale))
            .Order().ToArray();
        double? Quantile(double fraction)=>extents.Length==0?null:extents[(int)Math.Round((extents.Length-1)*fraction)];
        return new {classified=Filter?.Mode!=GalaxyMapMode.Realistic,powerTerritoryScaleIncluded=false,
            catalogueRows=Systems?.Count()??0,rowsWithOriginalAppearance=Systems?.Count(s=>s.OriginalAppearance is not null)??0,
            matchingRows=ordered.Length,inFrustum=extents.Length,halfExtentPixels=new {minimum=Quantile(0),median=Quantile(.5),p90=Quantile(.9),maximum=Quantile(1)}};
    }
}