Use typed runtime item catalog
This commit is contained in:
parent
0133531d40
commit
949907de65
11 changed files with 415 additions and 245 deletions
|
|
@ -36,8 +36,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
get => _gameDataDirectory ??= new DirectoryInfo(Application.dataPath).Parent.CreateSubdirectory("GameData");
|
||||
}
|
||||
|
||||
private static string LegacyAetherDatabasePath => LegacyItemCatalogBoundary.GetLegacyItemCatalogPath(GameDataDirectory);
|
||||
private static ILegacyItemCatalogReader LegacyCatalog => LegacyItemCatalogBoundary.GetCatalog(GameDataDirectory);
|
||||
|
||||
private static PlayerSettings _playerSettings;
|
||||
public static PlayerSettings PlayerSettings
|
||||
|
|
@ -245,9 +243,15 @@ public class ActionGameManager : MonoBehaviour
|
|||
Debug.Log($"Aetheria typed runtime catalog: {RuntimeCatalog.Items.Count} items, {RuntimeCatalog.Corporations.Count} corporations, {RuntimeCatalog.NameFiles.Count} name files");
|
||||
}
|
||||
|
||||
Debug.Log($"Aetheria legacy item catalog: {LegacyAetherDatabasePath}");
|
||||
if (RuntimeCatalog == null)
|
||||
{
|
||||
throw new InvalidOperationException("Aetheria typed runtime catalog is required before gameplay boot.");
|
||||
}
|
||||
|
||||
var runtimeItemCatalog = new AetheriaRuntimeItemCatalog(RuntimeCatalog);
|
||||
DatabaseLinkBase.BindRuntimeItemCatalog(runtimeItemCatalog);
|
||||
ItemManager = new ItemManager(
|
||||
LegacyCatalog,
|
||||
runtimeItemCatalog,
|
||||
Settings.GameplaySettings,
|
||||
Debug.Log);
|
||||
ZoneRenderer.ItemManager = ItemManager;
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
using System.IO;
|
||||
|
||||
public static class LegacyItemCatalogBoundary
|
||||
{
|
||||
private static LegacyItemCatalogCache _catalogCache;
|
||||
|
||||
public static string GetLegacyItemCatalogPath(DirectoryInfo gameDataDirectory)
|
||||
{
|
||||
return Path.Combine(gameDataDirectory.FullName, "AetherDB.msgpack");
|
||||
}
|
||||
|
||||
public static ILegacyItemCatalogReader GetCatalog(DirectoryInfo gameDataDirectory)
|
||||
{
|
||||
if (_catalogCache != null) return _catalogCache;
|
||||
|
||||
_catalogCache = new LegacyItemCatalogCache();
|
||||
_catalogCache.AddBackingStore(new SingleFileMessagePackBackingStore(GetLegacyItemCatalogPath(gameDataDirectory)));
|
||||
_catalogCache.PullAllBackingStores();
|
||||
DatabaseLinkBase.BindLegacyItemCatalog(_catalogCache);
|
||||
return _catalogCache;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f32bcbdbd7db4a3595f11f4540b90a3b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue