static public BotEngine.EveOnline.Interface.MemoryStruct.MemoryMeasurement AsOld( this Sanderling.Interface.MemoryStruct.IMemoryMeasurement memoryMeasurement, Func <object, object> mapDelegate) { var parsed = memoryMeasurement?.Parse(); if (parsed == null) { return(null); } return(new BotEngine.EveOnline.Interface.MemoryStruct.MemoryMeasurement { SessionDurationRemaining = parsed?.SessionDurationRemaining, Menu = parsed?.Menu?.Select(AsOld)?.ToArray(), AbovemainMessage = parsed?.AbovemainMessage?.AsOldUIElementLabelString()?.ToArray(), AbovemainPanelEveMenu = parsed?.AbovemainPanelEveMenu?.Select(AsOld)?.ToArray(), AbovemainPanelGroup = parsed?.AbovemainPanelGroup?.Select(AsOld)?.ToArray(), InfoPanelButtonIncursions = parsed?.InfoPanelButtonIncursions?.AsOldUIElement(), InfoPanelButtonLocationInfo = parsed?.InfoPanelButtonCurrentSystem?.AsOldUIElement(), InfoPanelButtonRoute = parsed?.InfoPanelButtonRoute?.AsOldUIElement(), InfoPanelButtonMissions = parsed?.InfoPanelButtonMissions?.AsOldUIElement(), InfoPanelLocationInfo = parsed?.InfoPanelCurrentSystem?.AsOld(), InfoPanelRoute = parsed?.InfoPanelRoute?.AsOld(), InfoPanelMissions = parsed?.InfoPanelMissions?.AsOld(), ModuleButtonTooltip = parsed?.ModuleButtonTooltip?.AsOld(), Neocom = parsed?.Neocom?.AsOld(), ShipUi = parsed?.ShipUi?.AsOld(), SystemMenu = parsed?.SystemMenu?.AsOldSystemMenu(), Target = parsed?.Target?.Select(AsOld)?.ToArray(), UtilmenuMission = parsed?.Utilmenu?.Select(c => c.AsOldUtilmenuMission(parsed))?.WhereNotDefault()?.FirstOrDefault(), VersionString = parsed?.VersionString, WindowAgentBrowser = parsed?.WindowAgentBrowser?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowAgentBrowser>())?.ToArray(), WindowAgentDialogue = parsed?.WindowAgentDialogue?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowAgentDialogue>())?.ToArray(), WindowChatChannel = parsed?.WindowChatChannel?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowChatChannel>())?.ToArray(), WindowDroneView = parsed?.WindowDroneView?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowDroneView>())?.ToArray(), WindowFittingMgmt = parsed?.WindowFittingMgmt?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowFittingMgmt>())?.ToArray(), WindowFittingWindow = parsed?.WindowShipFitting?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowFittingWindow>())?.ToArray(), WindowInventory = parsed?.WindowInventory?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowInventory>())?.ToArray(), WindowItemSell = parsed?.WindowItemSell?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowItemSell>())?.ToArray(), WindowMarketAction = parsed?.WindowMarketAction?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowMarketAction>())?.ToArray(), WindowOverview = parsed?.WindowOverview?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowOverView>())?.ToArray(), WindowOther = parsed?.WindowOther?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.Window>())?.ToArray(), WindowRegionalMarket = parsed?.WindowRegionalMarket?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowRegionalMarket>())?.ToArray(), WindowSelectedItemView = parsed?.WindowSelectedItemView?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowSelectedItemView>())?.ToArray(), WindowStack = parsed?.WindowStack?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowStack>())?.ToArray(), WindowStationLobby = parsed?.WindowStation?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowStationLobby>())?.ToArray(), WindowSurveyScanView = parsed?.WindowSurveyScanView?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowSurveyScanView>())?.ToArray(), WindowTelecom = parsed?.WindowTelecom?.Select(mapDelegate.CastReturn <BotEngine.EveOnline.Interface.MemoryStruct.WindowTelecom>())?.ToArray(), }); }
static public BotEngine.EveOnline.Interface.MemoryStruct.MemoryMeasurement AsOld( this Sanderling.Interface.MemoryStruct.IMemoryMeasurement memoryMeasurement) { var parsed = memoryMeasurement?.Parse(); if (parsed == null) { return(null); } var mappingContext = new MappingContext { GetMappingFuncFromTypeDelegate = type => MappingFuncFromTypeCache.ValueFürKey(type, MappingFuncFromType), }; return((BotEngine.EveOnline.Interface.MemoryStruct.MemoryMeasurement)mappingContext.Map(memoryMeasurement)); }