This commit is contained in:
Sakurai Ryota 2024-08-12 12:30:07 +09:00
parent 39561ef837
commit c8c152ae68
3 changed files with 24 additions and 0 deletions

View File

@ -6,5 +6,9 @@ public interface IStore<T> : IDisposable
public bool Add(T item);
public bool Has(T item);
public bool Remove(T item);
public IEnumerable<T> GetValues();
}

View File

@ -53,6 +53,16 @@ public class LocalStore<T> : IStore<T>
return true;
}
public bool Has(T item)
{
return this.items.Contains(item);
}
public bool Remove(T item)
{
return this.items.Remove(item);
}
public IEnumerable<T> GetValues()
{
return this.items.ToList();

View File

@ -26,6 +26,16 @@ public class JsonDB<T> : IDisposable
return this.store.Add(item);
}
public bool Has(T item)
{
return this.store.Has(item);
}
public bool Remove(T item)
{
return this.store.Remove(item);
}
public IEnumerable<T> GetValues()
{
return this.store.GetValues();