Exemplo n.º 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();
Exemplo n.º 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);
Exemplo n.º 3
0
        public WindowInventoryTreeViewShip(MemoryStruct.ITreeViewEntry raw)
        {
            this.Raw = raw;

            if (null == raw)
            {
                return;
            }

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