13 lines
409 B
C#
13 lines
409 B
C#
using System.Collections.Generic;
|
|
using XWorld.Framework;
|
|
|
|
namespace XWorld.Server.Host
|
|
{
|
|
public sealed class InMemoryStorage : IStorage
|
|
{
|
|
private readonly Dictionary<string, byte[]> _data = new Dictionary<string, byte[]>();
|
|
public byte[] Load(string key) => _data.TryGetValue(key, out var v) ? v : null;
|
|
public void Save(string key, byte[] data) => _data[key] = data;
|
|
}
|
|
}
|