29 lines
940 B
C#
Raw Normal View History

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using GameServiceWarden.ModuleAPI;
namespace GameServiceWarden.Core.Persistence
{
public interface IReadOnlyPersistent<V> : IEnumerable<KeyValuePair<string, V>>
{
V this[string key] { get; }
/// <summary>
/// The directory for this dictionary to use.
/// </summary>
string MapDirectory { get; }
int Count { get; }
IEnumerable<V> Values { get; }
IEnumerable<string> Keys { get; }
bool ContainsKey(string key);
/// <summary>
/// The path to the data representing a specific key.
/// </summary>
/// <param name="key">The key to get the path for.</param>
/// <returns>A <see cref="string"/> representing the key.</returns>
string GetPathForKey(string key);
2021-03-31 19:33:37 -05:00
bool TryLoadValue(string key, [MaybeNullWhen(false)] out V value);
}
}