Пример #1
0
        private string ComposeExtraInfo(SystemSummaryRow row, EntryScanAutoScan sas)
        {
            if (row.BodyType == BodyType.Star)
            {
                if (sas.StarType == "N")
                {
                    return("Neutron star");
                }
                return($"Startype: {sas.StarType}");
            }

            EntryScanDetailed sd = sas as EntryScanDetailed;

            if (sd != null)
            {
                if (!String.IsNullOrWhiteSpace(sd.PlanetClass))
                {
                    return($"{sd.PlanetClass}");
                }
            }

            if (row.Description.Contains(BELT_CLUSTER_ID))
            {
                int idx = row.Description.IndexOf(BELT_CLUSTER_ID);
                return(row.Description.Substring(idx));
            }

            return(row.ExtraInfo);
        }
Пример #2
0
        private SystemSummaryRow CreateOrGetRow(EntryScanAutoScan scan)
        {
            var match = this.receiver.SystemRows.FirstOrDefault(r => r.BodyId == scan.BodyID);

            if (match == null)
            {
                match              = new SystemSummaryRow();
                match.Order        = 1000 + scan.BodyID;
                match.BodyId       = scan.BodyID;
                match.Description  = scan.BodyName;
                match.ExtraInfo    = scan.ScanType.ToString();
                match.BodyType     = DetectBodyType(scan);
                match.IsDiscovered = scan.WasDiscovered;
                match.IsMapped     = scan.WasMapped;
                this.receiver.SystemRows.Add(match);
            }
            else if (match.DataOrigin == Core.DataOrigin.Edsm) // was only known from EDSM before...
            {
                match.ExtraInfo    = scan.ScanType.ToString();
                match.BodyType     = DetectBodyType(scan);
                match.IsDiscovered = scan.WasDiscovered;
                match.IsMapped     = scan.WasMapped;
            }

            match.Description = RestyleName(match.Description);

            return(match);
        }
Пример #3
0
        private void CreateDisplayEventForScanAuto(EntryScanAutoScan @as)
        {
            DisplayEvent de = new DisplayEvent()
            {
                Text      = $"Auto-Scanned {@as.BodyName} {@as.WasDiscovered} {@as.WasMapped}",
                EventType = DisplayEventType.Scan,
            };

            if (@as.WasDiscovered == false)
            {
                de.IsHighlighted  = true;
                de.Symbol2        = '\xf890'; // sparkles
                de.Symbol2Tooltip = "undiscovered!";
            }
            else
            {
                de.IsBoring = true;
            }
            this.receiver.Events.Add(de);
        }
Пример #4
0
        private BodyType DetectBodyType(EntryScanAutoScan scan)
        {
            if (!String.IsNullOrWhiteSpace(scan.StarType))
            {
                return(BodyType.Star);
            }
            if (scan.BodyName.Contains(BELT_CLUSTER_ID))
            {
                return(BodyType.BeltCluster);
            }
            var det = (scan as EntryScanDetailed);

            if (det != null)
            {
                if (!String.IsNullOrWhiteSpace(det.PlanetClass))
                {
                    return(BodyType.Planet);
                }
            }
            return(BodyType.Unknown);
        }