Exemple #1
0
 /// <summary>
 /// Removes a single item
 /// </summary>
 /// <param name="item">The item to replace</param>
 public void RemoveItem(ItemJSON item)
 {
     if (_database.ContainsKey(item.Name))
     {
         _database.Remove(item.Name);
         writeOut();
         Updated?.Invoke();
     }
 }
Exemple #2
0
 /// <summary>
 /// Adds an item to the JSON database
 /// </summary>
 /// <param name="item">The item to add</param>
 public void AddItem(ItemJSON item)
 {
     if (!_database.ContainsKey(item.Name))
     {
         _database.Add(item.Name, item);
         writeOut();
         Updated?.Invoke();
     }
 }