示例#1
0
 static public ShipCargoSpaceTypeEnum?CargoSpaceTypeFromTreeEntry(
     this MemoryStruct.ITreeViewEntry entryShip,
     MemoryStruct.ITreeViewEntry entryCargoSpace) =>
 FromShipExtractSetCargoSpaceTypeAndTreeEntry(entryShip)
 ?.Where(cargoShipTypeAndTreeEntry => cargoShipTypeAndTreeEntry.Value == entryCargoSpace)
 ?.Select(cargoShipTypeAndTreeEntry => cargoShipTypeAndTreeEntry.Key)
 ?.CastToNullable()
 ?.FirstOrDefault();
示例#2
0
 static public IEnumerable <KeyValuePair <ShipCargoSpaceTypeEnum, MemoryStruct.ITreeViewEntry> > FromShipExtractSetCargoSpaceTypeAndTreeEntry(
     this MemoryStruct.ITreeViewEntry shipTreeEntry) =>
 new[] { new KeyValuePair <ShipCargoSpaceTypeEnum, MemoryStruct.ITreeViewEntry>(ShipCargoSpaceTypeEnum.General, shipTreeEntry) }
 .ConcatNullable(InventoryCargoTypeAndSetLabel?.Select(cargoTypeAndSetLabel =>
                                                       new KeyValuePair <ShipCargoSpaceTypeEnum, MemoryStruct.ITreeViewEntry>(
                                                           cargoTypeAndSetLabel.Key,
                                                           shipTreeEntry?.EnumerateChildNodeTransitive()
                                                           ?.FirstOrDefault(node => node?.Text?.FromIventoryLabelParseShipCargoSpaceType() == cargoTypeAndSetLabel.Key))))
 ?.Where(treeEntryForCargoSpaceType => null != treeEntryForCargoSpaceType.Value);
示例#3
0
        public WindowInventoryTreeViewShip(MemoryStruct.ITreeViewEntry raw)
        {
            this.Raw = raw;

            if (null == raw)
            {
                return;
            }

            SetCargoSpaceTypeAndTreeEntry = raw.FromShipExtractSetCargoSpaceTypeAndTreeEntry()?.ToArray();
        }
示例#4
0
        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);
        }
示例#5
0
		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);
		}
示例#6
0
 static public IInventoryTreeViewEntryShip ParseAsInventoryTreeEntryShip(this MemoryStruct.ITreeViewEntry treeViewEntry) =>
 null == treeViewEntry ? null : new WindowInventoryTreeViewShip(treeViewEntry);
示例#7
0
 static public MemoryStruct.ITreeViewEntry TreeEntryFromCargoSpaceType(
     this MemoryStruct.ITreeViewEntry shipTreeEntry,
     ShipCargoSpaceTypeEnum cargoSpaceType) =>
 FromShipExtractSetCargoSpaceTypeAndTreeEntry(shipTreeEntry)
 ?.FirstOrDefault(treeEntryForCargoShipType => treeEntryForCargoShipType.Key == cargoSpaceType).Value;