Add dictionary reset helper method

This commit is contained in:
Matt Nadareski
2024-03-19 18:40:24 -04:00
parent 3d2c3af88b
commit 7b889e57db
2 changed files with 20 additions and 14 deletions

View File

@@ -34,13 +34,13 @@ namespace SabreTools.DatFiles
/// DatItems and related statistics
/// </summary>
[JsonProperty("items"), XmlElement("items")]
public ItemDictionary Items { get; set; } = [];
public ItemDictionary Items { get; private set; } = [];
/// <summary>
/// DatItems and related statistics
/// </summary>
[JsonProperty("items"), XmlElement("items")]
public ItemDictionaryDB ItemsDB { get; set; } = new ItemDictionaryDB();
public ItemDictionaryDB ItemsDB { get; private set; } = new ItemDictionaryDB();
#endregion
@@ -155,6 +155,19 @@ namespace SabreTools.DatFiles
#endregion
#region
/// <summary>
/// Reset the internal item dictionary
/// </summary>
public void ResetDictionary()
{
Items = [];
ItemsDB = new ItemDictionaryDB();
}
#endregion
#region Filtering
/// <summary>