Example #1
0
        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);
        }
Example #2
0
 static public bool IsNoItem(this MemoryStruct.IListEntry listEntry) =>
 NoItemRegex.MatchSuccess(listEntry?.LabelTextLargest()?.Text);