mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove unused DB methods
This commit is contained in:
@@ -367,70 +367,6 @@ namespace SabreTools.DatFiles
|
|||||||
return datItems;
|
return datItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the indices and items associated with a machine index
|
|
||||||
/// </summary>
|
|
||||||
public IDictionary<long, DatItem>? GetItemsForMachine(long machineIndex, bool filter = false)
|
|
||||||
{
|
|
||||||
var itemIds = _itemToMachineMapping
|
|
||||||
.Where(mapping => mapping.Value == machineIndex)
|
|
||||||
.Select(mapping => mapping.Key);
|
|
||||||
|
|
||||||
var datItems = new Dictionary<long, DatItem>();
|
|
||||||
foreach (long itemId in itemIds)
|
|
||||||
{
|
|
||||||
// Ignore missing IDs
|
|
||||||
#if NET40_OR_GREATER || NETCOREAPP
|
|
||||||
if (!_items.TryGetValue(itemId, out var datItem) || datItem == null)
|
|
||||||
continue;
|
|
||||||
#else
|
|
||||||
if (!_items.ContainsKey(itemId))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var datItem = _items[itemId];
|
|
||||||
if (datItem == null)
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!filter || datItem.GetBoolFieldValue(DatItem.RemoveKey) != true)
|
|
||||||
datItems[itemId] = datItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
return datItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the indices and items associated with a source index
|
|
||||||
/// </summary>
|
|
||||||
public IDictionary<long, DatItem>? GetItemsForSource(long sourceIndex, bool filter = false)
|
|
||||||
{
|
|
||||||
var itemIds = _itemToSourceMapping
|
|
||||||
.Where(mapping => mapping.Value == sourceIndex)
|
|
||||||
.Select(mapping => mapping.Key);
|
|
||||||
|
|
||||||
var datItems = new Dictionary<long, DatItem>();
|
|
||||||
foreach (long itemId in itemIds)
|
|
||||||
{
|
|
||||||
// Ignore missing IDs
|
|
||||||
#if NET40_OR_GREATER || NETCOREAPP
|
|
||||||
if (!_items.TryGetValue(itemId, out var datItem) || datItem == null)
|
|
||||||
continue;
|
|
||||||
#else
|
|
||||||
if (!_items.ContainsKey(itemId))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var datItem = _items[itemId];
|
|
||||||
if (datItem == null)
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!filter || datItem.GetBoolFieldValue(DatItem.RemoveKey) != true)
|
|
||||||
datItems[itemId] = datItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
return datItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a machine based on the index
|
/// Get a machine based on the index
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user