public WindowInventoryTreeViewShip(MemoryStruct.ITreeViewEntry Raw) { this.Raw = Raw; if (null == Raw) { return; } SetCargoSpaceTypeAndTreeEntry = Raw.FromShipExtractSetCargoSpaceTypeAndTreeEntry()?.ToArray(); }
public MemoryMeasurement(MemoryStruct.IMemoryMeasurement raw) { this.Raw = raw; if (null == raw) return; Culture.InvokeInParseCulture(() => { Target = raw?.Target?.Select(ShipUiExtension.Parse)?.ToArray(); ModuleButtonTooltip = raw?.ModuleButtonTooltip?.ParseAsModuleButtonTooltip(); WindowOverview = raw?.WindowOverview?.Select(OverviewExtension.Parse)?.ToArray(); WindowInventory = raw?.WindowInventory?.Select(InventoryExtension.Parse)?.ToArray(); WindowAgentDialogue = raw?.WindowAgentDialogue?.Select(DialogueMissionExtension.Parse)?.ToArray(); ShipUi = raw?.ShipUi?.Parse(); var SetWindowStation = raw?.WindowStation; if (!SetWindowStation.IsNullOrEmpty()) { IsDocked = true; } if (null != ShipUi || (raw?.WindowOverview?.WhereNotDefault()?.Any() ?? false)) { IsDocked = false; } if (!(IsDocked ?? true)) IsUnDocking = false; if (SetWindowStation?.Any(windowStation => windowStation?.AboveServicesLabel?.Any(labelText => labelText?.Text?.RegexMatchSuccessIgnoreCase(@"abort\s*undock|undocking") ?? false) ?? false) ?? false) IsUnDocking = true; Neocom = raw?.Neocom?.Parse(); Menu = raw?.Menu?.Select(menu => menu?.Parse())?.ToArrayIfNotEmpty(); InfoPanelCurrentSystem = raw?.InfoPanelCurrentSystem?.Parse(); }); }
public OverviewEntry(MemoryStruct.IOverviewEntry Raw) : base(Raw) { this.Raw = Raw; MainIcon = Raw?.SetSprite?.FirstOrDefault(Sprite => Sprite?.Name == "iconSprite"); MainIconIsRed = MainIcon?.Color?.IsRed(); var ContainsLeftIconWithNameMatchingRegexPattern = new Func<string, bool>(regexPattern => Raw?.SetSprite?.Any(Sprite => (Sprite?.Name).RegexMatchSuccessIgnoreCase(regexPattern)) ?? false); var ContainsRightIconWithHintMatchingRegexPattern = new Func<string, bool>(regexPattern => Raw?.RightIcon?.Any(Sprite => (Sprite?.HintText).RegexMatchSuccessIgnoreCase(regexPattern)) ?? false); IsAttackingMe = ContainsLeftIconWithNameMatchingRegexPattern("attacking.*me"); IsJammingMe = ContainsRightIconWithHintMatchingRegexPattern("jamming.*me"); }
public OverviewEntry(MemoryStruct.IOverviewEntry raw) : base(raw) { this.Raw = raw; MainIcon = raw?.SetSprite?.FirstOrDefault(sprite => sprite?.Name == "iconSprite"); MainIconIsRed = MainIcon?.Color?.IsRed(); var MainIconContainsIndicatorWithNameMatchingRegexPattern = new Func<string, bool>(regexPattern => raw?.MainIconSetIndicatorName?.Any(indicatorName => indicatorName.RegexMatchSuccessIgnoreCase(regexPattern)) ?? false); IsAttackingMe = MainIconContainsIndicatorWithNameMatchingRegexPattern("attacking.*me"); IsHostile = MainIconContainsIndicatorWithNameMatchingRegexPattern("hostile"); MeTargeting = MainIconContainsIndicatorWithNameMatchingRegexPattern("targeting"); MeTargeted = MainIconContainsIndicatorWithNameMatchingRegexPattern("targetedByMe"); MeActiveTarget = MainIconContainsIndicatorWithNameMatchingRegexPattern("myActiveTarget"); EWarType = RightIcon?.Select(OverviewExtension.EWarTypeFromOverviewEntryRightIcon)?.WhereNotNullSelectValue()?.ToArrayIfNotEmpty(); }
public ShipUiTarget(MemoryStruct.IShipUiTarget Raw) { this.Raw = Raw; if (null == Raw) { return; } var TextRow = Raw?.LabelText?.OrderByCenterVerticalDown() ?.Select(LabelText => LabelText?.Text?.RemoveXmlTag()) ?.ToArray(); var DistanceMinMax = TextRow?.LastOrDefault()?.DistanceParseMinMaxKeyValue(); DistanceMin = DistanceMinMax?.Key; DistanceMax = DistanceMinMax?.Value; this.TextRow = TextRow?.Reverse()?.Skip(1)?.Reverse()?.ToArray(); }
public Neocom(MemoryStruct.INeocom Raw) { this.Raw = Raw; if (null == Raw) { return; } var ButtonWithTexturePathMatch = new Func<string, MemoryStruct.IUIElement>(TexturePathRegexPattern => Raw?.Button?.FirstOrDefault(candidate => candidate?.TexturePath?.RegexMatchSuccess(TexturePathRegexPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase) ?? false)); PeopleAndPlacesButton = ButtonWithTexturePathMatch("peopleandplaces"); ChatButton = ButtonWithTexturePathMatch("chat"); MailButton = ButtonWithTexturePathMatch("mail"); FittingButton = ButtonWithTexturePathMatch("fitting"); InventoryButton = ButtonWithTexturePathMatch("items"); MarketButton = ButtonWithTexturePathMatch("market"); }
static public ShipCargoSpaceTypeEnum? CargoSpaceTypeFromTreeEntry( this MemoryStruct.ITreeViewEntry EntryShip, MemoryStruct.ITreeViewEntry EntryCargoSpace) => FromShipExtractSetCargoSpaceTypeAndTreeEntry(EntryShip) ?.Where(CargoShipTypeAndTreeEntry => CargoShipTypeAndTreeEntry.Value == EntryCargoSpace) ?.Select(CargoShipTypeAndTreeEntry => CargoShipTypeAndTreeEntry.Key) ?.CastToNullable() ?.FirstOrDefault();
public WindowInventory(MemoryStruct.IWindowInventory Raw) { this.Raw = Raw; if (null == Raw) { return; } ActiveShipEntry = Raw.TreeEntryActiveShip()?.ParseAsInventoryTreeEntryShip(); SelectedRightInventoryCapacityMilli = Raw?.SelectedRightInventoryCapacity?.Text?.ParseAsInventoryCapacityGaugeMilli(); ItemHangarEntry = Raw?.LeftTreeListEntry?.FirstOrDefault(c => c?.Text?.RegexMatchSuccess(@"item\s*hangar", RegexOptions.IgnoreCase) ?? false); }
public MemoryMeasurement(MemoryStruct.IMemoryMeasurement Raw) { this.Raw = Raw; if (null == Raw) { return; } Culture.InvokeInParseCulture(() => { Target = Raw?.Target?.Select(ShipUiExtension.Parse)?.ToArray(); ModuleButtonTooltip = Raw?.ModuleButtonTooltip?.ParseAsModuleButtonTooltip(); WindowOverview = Raw?.WindowOverview?.Select(OverviewExtension.Parse)?.ToArray(); WindowInventory = Raw?.WindowInventory?.Select(InventoryExtension.Parse)?.ToArray(); WindowAgentDialogue = Raw?.WindowAgentDialogue?.Select(DialogueMissionExtension.Parse)?.ToArray(); var ShipUi = Raw?.ShipUi; var SetWindowStation = Raw?.WindowStation; if (!SetWindowStation.IsNullOrEmpty()) { IsDocked = true; } if (null != ShipUi || (Raw?.WindowOverview?.WhereNotDefault()?.Any() ?? false)) { IsDocked = false; } if (!(IsDocked ?? true)) { IsUnDocking = false; } if (SetWindowStation?.Any(WindowStationLobby => WindowStationLobby?.LabelText?.Any(LabelText => LabelText?.Text?.RegexMatchSuccess(@"abort\s*undock|undocking") ?? false) ?? false) ?? false) { IsUnDocking = true; } Neocom = Raw?.Neocom?.Parse(); }); }
public WindowOverview(MemoryStruct.IWindowOverview Raw) { this.Raw = Raw; if (null == Raw) { return; } ListView = Raw?.ListView?.Map(OverviewExtension.Parse); }
public ModuleButtonTooltip(MemoryStruct.IContainer Raw) { this.Raw = Raw; if (null == Raw) { return; } var LabelRegexMatchSuccessIgnoreCase = new Func<string, bool>( Pattern => Raw?.LabelText?.Any(Label => Label?.Text?.RegexMatchSuccess(Pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase) ?? false) ?? false); var LabelAnyRegexMatchSuccessIgnoreCase = new Func<string[], bool>( SetPattern => SetPattern?.Any(LabelRegexMatchSuccessIgnoreCase) ?? false); IsWeapon = LabelAnyRegexMatchSuccessIgnoreCase(IsWeaponSetIndicatorLabelRegexPattern); IsTargetPainter = LabelAnyRegexMatchSuccessIgnoreCase(IsTargetPainterSetIndicatorLabelRegexPattern); IsHardener = LabelAnyRegexMatchSuccessIgnoreCase(IsHardenerSetIndicatorLabelRegexPattern); IsShieldBooster = LabelAnyRegexMatchSuccessIgnoreCase(IsShieldBoosterSetIndicatorLabelRegexPattern); IsArmorRepairer = LabelAnyRegexMatchSuccessIgnoreCase(IsArmorRepairerSetIndicatorLabelRegexPattern); IsMiner = LabelAnyRegexMatchSuccessIgnoreCase(IsMinerSetIndicatorLabelRegexPattern); IsSurveyScanner = LabelRegexMatchSuccessIgnoreCase(@"Survey\s*Scan"); var MatchFromLabelWithRegexPattern = new Func<string, System.Text.RegularExpressions.Match>(regexPattern => Raw?.LabelText?.Select(LabelText => LabelText?.Text?.RegexMatchIfSuccess(regexPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase))?.WhereNotDefault()?.FirstOrDefault()); var DistanceMinFromLabelWithRegexPattern = new Func<string, int?>(prefixPattern => (int?)Distance.DistanceParseMin(MatchFromLabelWithRegexPattern(prefixPattern + Distance.DistanceRegexPattern)?.Value?.RegexMatchIfSuccess(Distance.DistanceRegexPattern)?.Value)); RangeWithin = DistanceMinFromLabelWithRegexPattern(@"^Range within\s*"); RangeOptimal = DistanceMinFromLabelWithRegexPattern(@"Optimal range within\s*"); RangeFalloff = DistanceMinFromLabelWithRegexPattern(@"Falloff range within\s*"); SignatureRadiusModifierMilli = (int?)MatchFromLabelWithRegexPattern(@"(" + Number.DefaultNumberFormatRegexPatternAllowLeadingAndTrailingChars + @")\s*%\s*Signature\s*Radius\s*(Modifier|Bonus)")?.Groups[1]?.Value?.NumberParseDecimalMilli() / 100; ToggleKeyTextLabel = Raw?.LabelText?.OrderByNearestPointOnLine(new Vektor2DInt(-1, 1), label => label?.RegionCenter())?.FirstOrDefault(); ToggleKey = ToggleKeyTextLabel?.Text?.ListKeyCodeFromUIText()?.ToArray(); }
public Menu(MemoryStruct.IMenu raw) { this.raw = raw; Entry = raw?.Entry?.Select(entry => entry?.Parse())?.ToArray(); }
public MenuEntry(MemoryStruct.IMenuEntry raw) { this.raw = raw; }