Add transformative get-only accessors for IDDB

This commit is contained in:
Matt Nadareski
2024-03-19 23:38:56 -04:00
parent c2ca5a0a6d
commit 1c1ef29e90

View File

@@ -306,10 +306,14 @@ namespace SabreTools.DatFiles
} }
/// <summary> /// <summary>
/// Get all items from the current dictionary /// Get all item mappings
/// </summary> /// </summary>
public DatItem[] GetItems() public (long, long)[] GetItemMappings() => _itemToMachineMapping.Select(kvp => (kvp.Key, kvp.Value)).ToArray();
=> _items.Select(kvp => kvp.Value).ToArray();
/// <summary>
/// Get all items and their indicies
/// </summary>
public (long, DatItem)[] GetItems() => _items.Select(kvp => (kvp.Key, kvp.Value)).ToArray();
/// <summary> /// <summary>
/// Get the indices and items associated with a bucket name /// Get the indices and items associated with a bucket name
@@ -390,10 +394,9 @@ namespace SabreTools.DatFiles
} }
/// <summary> /// <summary>
/// Get all machines from the current dictionary /// Get all machines and their indicies
/// </summary> /// </summary>
public Machine[] GetMachines() public (long, Machine)[] GetMachines() => _machines.Select(kvp => (kvp.Key, kvp.Value)).ToArray();
=> _machines.Select(kvp => kvp.Value).ToArray();
/// <summary> /// <summary>
/// Remove an item, returning if it could be removed /// Remove an item, returning if it could be removed