static public BotEngine.EveOnline.Interface.MemoryStruct.ListEntry AsOldListEntry( this Sanderling.Interface.MemoryStruct.IListEntry entry, bool toDrone) { if (entry == null) { return(null); } var @base = new BotEngine.EveOnline.Interface.MemoryStruct.ListEntry(entry.AsOldUIElement()) { ContentBoundLeft = entry?.ContentBoundLeft, GroupExpander = entry?.GroupExpander?.AsOldUIElement(), IsExpanded = entry?.IsExpanded, IsGroup = entry?.IsGroup, IsSelected = entry?.IsSelected, SetSprite = entry?.SetSprite?.Select(AsOld)?.ToArray(), ListBackgroundColor = entry?.ListBackgroundColor, ListColumnCellLabel = entry?.ListColumnCellLabel?.Select(c => new KeyValuePair <BotEngine.EveOnline.Interface.MemoryStruct.ListColumnHeader, string>(c.Key.AsOld(), c.Value))?.ToArray(), Label = entry?.LabelText?.Largest()?.AsOldUIElementLabelString(), }; var droneEntry = entry as IDroneViewEntryItem; var overviewEntry = entry as Sanderling.Parse.IOverviewEntry; if (overviewEntry != null) { return new BotEngine.EveOnline.Interface.MemoryStruct.OverviewEntry(@base) { RightIcon = overviewEntry?.RightIcon?.Select(AsOld)?.ToArray(), } } ; if (droneEntry != null) { return new BotEngine.EveOnline.Interface.MemoryStruct.DroneViewEntryItem(@base) { Hitpoints = droneEntry?.Hitpoints?.AsOld(), } } ; if (toDrone && (entry?.IsGroup ?? false)) { return new BotEngine.EveOnline.Interface.MemoryStruct.DroneViewEntryGroup(@base) { Caption = entry?.LabelTextLargest()?.AsOldUIElementLabelString(), } } ; return(@base); }
public ListEntry(MemoryStruct.IListEntry raw) { this.Raw = raw; if (null == raw) { return; } var DistanceMinMax = raw?.ColumnDistanceValue()?.DistanceParseMinMaxKeyValue(); DistanceMin = DistanceMinMax?.Key; DistanceMax = DistanceMinMax?.Value; Type = raw?.ColumnTypeValue(); Name = raw?.ColumnNameValue(); }
static public string ColumnDistanceValue(this MemoryStruct.IListEntry listEntry) => CellValueFromColumnHeader(listEntry, "distance");
static public IListEntry ParseAsListEntry(this MemoryStruct.IListEntry listEntry) => null == listEntry ? null : new ListEntry(listEntry);
static public string CellValueFromColumnHeader( this MemoryStruct.IListEntry listEntry, string headerLabel) => listEntry?.ListColumnCellLabel ?.FirstOrDefault(cell => (cell.Key?.Text).EqualsIgnoreCase(headerLabel)) .Value;
static public bool IsNoItem(this MemoryStruct.IListEntry listEntry) => NoItemRegex.MatchSuccess(listEntry?.LabelTextLargest()?.Text);
static public IUIElementText LabelTextLargest(this MemoryStruct.IListEntry listEntry) => listEntry?.LabelText?.Largest();
public static bool ActuallyAnomaly(IListEntry scanResult) { return(scanResult?.CellValueFromColumnHeader("Distance")?.RegexMatchSuccessIgnoreCase("km") ?? false); }
static public string ColumnNameValue(this MemoryStruct.IListEntry ListEntry) => CellValueFromColumnHeader(ListEntry, "name");