Modular Database Upgrade

CultCache API can now be configured with multiple interchangeable backing stores. Will be using plain JSON in repository from now on.
This commit is contained in:
Reinier Vens 2021-06-23 04:25:23 +01:00
commit 85483319fe
158 changed files with 658 additions and 290 deletions

View file

@ -84,8 +84,13 @@ public class ActionGameManager : MonoBehaviour
{
if (_cultCache != null) return _cultCache;
_cultCache = new CultCache(Path.Combine(GameDataDirectory.FullName, "AetherDB.msgpack"));
_cultCache.Load();
_cultCache = new CultCache();
_cultCache.AddBackingStore(new MultiFileJsonBackingStore(GameDataDirectory.FullName));
_cultCache.AddBackingStore(
new SingleFileMessagePackBackingStore(Path.Combine(GameDataDirectory.FullName, "AetherDB.msgpack")));
// _cultCache.AddBackingStore(
// new MultiFileMessagePackBackingStore(GameDataDirectory.FullName), typeof(NameFile));
_cultCache.PullAllBackingStores();
return _cultCache;
}