Shuffle private methods

This commit is contained in:
Matt Nadareski
2025-01-29 20:52:40 -05:00
parent 78983ddf6f
commit f2f99b412f

View File

@@ -245,60 +245,6 @@ namespace SabreTools.DatFiles
} }
} }
/// <summary>
/// Increment the hash count for a given hash type
/// </summary>
/// <param name="hashType">Hash type to increment</param>
/// <param name="interval">Amount to increment by, defaults to 1</param>
private void AddHashCount(HashType hashType, long interval = 1)
{
lock (_hashCounts)
{
if (!_hashCounts.ContainsKey(hashType))
_hashCounts[hashType] = 0;
_hashCounts[hashType] += interval;
if (_hashCounts[hashType] < 0)
_hashCounts[hashType] = 0;
}
}
/// <summary>
/// Increment the item count for a given item type
/// </summary>
/// <param name="itemType">Item type to increment</param>
/// <param name="interval">Amount to increment by, defaults to 1</param>
private void AddItemCount(ItemType itemType, long interval = 1)
{
lock (_itemCounts)
{
if (!_itemCounts.ContainsKey(itemType))
_itemCounts[itemType] = 0;
_itemCounts[itemType] += interval;
if (_itemCounts[itemType] < 0)
_itemCounts[itemType] = 0;
}
}
/// <summary>
/// Increment the item count for a given item status
/// </summary>
/// <param name="itemStatus">Item type to increment</param>
/// <param name="interval">Amount to increment by, defaults to 1</param>
private void AddStatusCount(ItemStatus itemStatus, long interval = 1)
{
lock (_statusCounts)
{
if (!_statusCounts.ContainsKey(itemStatus))
_statusCounts[itemStatus] = 0;
_statusCounts[itemStatus] += interval;
if (_statusCounts[itemStatus] < 0)
_statusCounts[itemStatus] = 0;
}
}
/// <summary> /// <summary>
/// Remove from the statistics given a DatItem /// Remove from the statistics given a DatItem
/// </summary> /// </summary>
@@ -380,6 +326,60 @@ namespace SabreTools.DatFiles
RemovedCount = 0; RemovedCount = 0;
} }
/// <summary>
/// Increment the hash count for a given hash type
/// </summary>
/// <param name="hashType">Hash type to increment</param>
/// <param name="interval">Amount to increment by, defaults to 1</param>
private void AddHashCount(HashType hashType, long interval = 1)
{
lock (_hashCounts)
{
if (!_hashCounts.ContainsKey(hashType))
_hashCounts[hashType] = 0;
_hashCounts[hashType] += interval;
if (_hashCounts[hashType] < 0)
_hashCounts[hashType] = 0;
}
}
/// <summary>
/// Increment the item count for a given item type
/// </summary>
/// <param name="itemType">Item type to increment</param>
/// <param name="interval">Amount to increment by, defaults to 1</param>
private void AddItemCount(ItemType itemType, long interval = 1)
{
lock (_itemCounts)
{
if (!_itemCounts.ContainsKey(itemType))
_itemCounts[itemType] = 0;
_itemCounts[itemType] += interval;
if (_itemCounts[itemType] < 0)
_itemCounts[itemType] = 0;
}
}
/// <summary>
/// Increment the item count for a given item status
/// </summary>
/// <param name="itemStatus">Item type to increment</param>
/// <param name="interval">Amount to increment by, defaults to 1</param>
private void AddStatusCount(ItemStatus itemStatus, long interval = 1)
{
lock (_statusCounts)
{
if (!_statusCounts.ContainsKey(itemStatus))
_statusCounts[itemStatus] = 0;
_statusCounts[itemStatus] += interval;
if (_statusCounts[itemStatus] < 0)
_statusCounts[itemStatus] = 0;
}
}
/// <summary> /// <summary>
/// Decrement the hash count for a given hash type /// Decrement the hash count for a given hash type
/// </summary> /// </summary>