Rename Unity loadout item projector factory

This commit is contained in:
Meta Vens 2026-06-28 14:33:52 +01:00
commit 203fe80c0e
8 changed files with 41 additions and 41 deletions

View file

@ -8589,7 +8589,7 @@ static void RequireClientTargetBootAuthority(string root)
"boot.RuntimeCatalog,",
"SceneWiring.ConfigureActionBarPresentation(",
"ItemManager = boot.ItemManager;",
"_loadoutItemProjector = boot.LoadoutItemProjector;"
"_loadoutItemFactory = boot.LoadoutItemFactory;"
};
var missingActionGameManagerSymbols = requiredActionGameManagerSymbols
.Where(symbol => !actionGameManager.Contains(symbol, StringComparison.Ordinal))
@ -8639,8 +8639,8 @@ static void RequireClientTargetBootAuthority(string root)
".ObserveSectorMap()",
"sectorMapSession.Current",
"new ItemManager(",
"new AetheriaUnityLoadoutItemProjector(itemManager, runtimeCatalog)",
"ZoneRenderer.SetDroppedPickupItemProjector(loadoutItemProjector.CreateLoadoutItem)",
"new AetheriaUnityLoadoutItemFactory(itemManager, runtimeCatalog)",
"ZoneRenderer.SetDroppedPickupItemFactory(loadoutItemFactory.CreateLoadoutItem)",
"ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections",
"AetheriaUnityRenderSettingsBridge.Build(",
"CockpitHudShell.SetRenderSettings(ZoneRenderer.RenderSettings)",
@ -12248,7 +12248,7 @@ static void RequireMainMenuContinueRunState(string root)
"private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex",
"private AetheriaUnityEntityConstructionBlueprintProjector EntityConstructionBlueprintProjector =>",
"EntityConstructionBlueprintProjector.ProjectObservedEntity",
"_loadoutItemProjector.CreateLoadoutItem",
"_loadoutItemFactory.CreateLoadoutItem",
"private AetheriaUnityObservedDockingIndex ObservedDocking =>",
"ObservedDocking.IsEntityUndocked(CurrentEntity)",
"IsCurrentEntityObservedUndocked(",
@ -12394,8 +12394,8 @@ static void RequireMainMenuContinueRunState(string root)
"blueprint.Equipment = CreateEquippableSlots(entity.Equipment)",
"blueprint.CargoContents = CreateCargoBayContents(entity.CargoContents)",
"blueprint.Children = entity.Children",
"_loadoutItemProjector.CreateLoadoutItem(slot.Item)",
"_loadoutItemProjector.CreateLoadoutItem(item) as EquippableItem"
"_loadoutItemFactory.CreateLoadoutItem(slot.Item)",
"_loadoutItemFactory.CreateLoadoutItem(item) as EquippableItem"
};
var missingEntityConstructionBlueprintProjectorSymbols = requiredEntityConstructionBlueprintProjectorSymbols
.Where(symbol => !entityConstructionBlueprintProjector.Contains(symbol, StringComparison.Ordinal))
@ -13250,7 +13250,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
"entity => CurrentEntityBinder.RestoreBinding(entity)",
"private AetheriaUnityEntityConstructionBlueprintProjector EntityConstructionBlueprintProjector =>",
"EntityConstructionBlueprintProjector.ProjectObservedEntity",
"_loadoutItemProjector.CreateLoadoutItem",
"_loadoutItemFactory.CreateLoadoutItem",
"private AetheriaUnityPilotCommandSender PilotCommands =>",
"private AetheriaUnityPilotFrameAdapter PilotFrameAdapter =>",
"PilotFrameAdapter = PilotFrameAdapter",
@ -13328,8 +13328,8 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
"blueprint.Equipment = CreateEquippableSlots(entity.Equipment)",
"blueprint.CargoContents = CreateCargoBayContents(entity.CargoContents)",
"blueprint.Children = entity.Children",
"_loadoutItemProjector.CreateLoadoutItem(slot.Item)",
"_loadoutItemProjector.CreateLoadoutItem(item) as EquippableItem"
"_loadoutItemFactory.CreateLoadoutItem(slot.Item)",
"_loadoutItemFactory.CreateLoadoutItem(item) as EquippableItem"
};
var missingEntityConstructionBlueprintProjectorSymbols = requiredEntityConstructionBlueprintProjectorSymbols
.Where(symbol => !entityConstructionBlueprintProjector.Contains(symbol, StringComparison.Ordinal))
@ -15211,7 +15211,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
"SceneWiring.ConfigureTargetPresentation(",
"SceneWiring.ConfigureActionBarPresentation(",
"ItemManager = boot.ItemManager;",
"_loadoutItemProjector = boot.LoadoutItemProjector;",
"_loadoutItemFactory = boot.LoadoutItemFactory;",
"AetheriaUnityRuntimeClientProvider.PlayerSettings",
"ResolveDaemonObserver()",
"private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>"
@ -15240,8 +15240,8 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
".ObserveSectorMap()",
"sectorMapSession.Current",
"new ItemManager(",
"new AetheriaUnityLoadoutItemProjector(itemManager, runtimeCatalog)",
"ZoneRenderer.SetDroppedPickupItemProjector(loadoutItemProjector.CreateLoadoutItem)",
"new AetheriaUnityLoadoutItemFactory(itemManager, runtimeCatalog)",
"ZoneRenderer.SetDroppedPickupItemFactory(loadoutItemFactory.CreateLoadoutItem)",
"ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections",
"AetheriaUnityRenderSettingsBridge.Build(",
"CockpitHudShell.SetRenderSettings(ZoneRenderer.RenderSettings)",
@ -15608,7 +15608,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
"AetheriaRuntimeStateBoot.Inspect(",
"ResolveClient(stateBoot.StateFilePath).OpenRuntimeCatalog()",
"ItemManager = new ItemManager(",
"ZoneRenderer.SetDroppedPickupItemProjector(",
"ZoneRenderer.SetDroppedPickupItemFactory(",
"ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections",
"ResolveRuntimeVerseClient(",
"PlayerSettingsAsync()",
@ -16884,29 +16884,29 @@ static void RequireDroppedPickupCheckpointState(string root)
},
[Path.Combine(root, "Assets", "Scripts", "Gameplay", "ActionGameManager.cs")] = new[]
{
"private AetheriaUnityLoadoutItemProjector _loadoutItemProjector",
"_loadoutItemProjector = boot.LoadoutItemProjector"
"private AetheriaUnityLoadoutItemFactory _loadoutItemFactory",
"_loadoutItemFactory = boot.LoadoutItemFactory"
},
[Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityGameplayBootShell.cs")] = new[]
{
"public sealed class AetheriaUnityGameplayBootShell",
"ZoneRenderer.SetDroppedPickupItemProjector(loadoutItemProjector.CreateLoadoutItem)"
"ZoneRenderer.SetDroppedPickupItemFactory(loadoutItemFactory.CreateLoadoutItem)"
},
[Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedFrameApplier.cs")] = new[]
{
"public sealed class AetheriaUnityObservedFrameApplier",
"zoneRenderer?.RestoreDroppedPickupsFromZoneRender(render)"
},
[Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityLoadoutItemProjector.cs")] = new[]
[Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityLoadoutItemFactory.cs")] = new[]
{
"public sealed class AetheriaUnityLoadoutItemProjector",
"public sealed class AetheriaUnityLoadoutItemFactory",
"public ItemInstance CreateLoadoutItem(AetheriaRuntimeLoadoutItemCommit item)",
"_itemManager.CreateSimpleCommodityInstance",
"_itemManager.CreateCraftedInstance"
},
[Path.Combine(root, "Assets", "Scripts", "Zone Display", "ZoneRenderer.cs")] = new[]
{
"public void SetDroppedPickupItemProjector(Func<AetheriaRuntimeLoadoutItemCommit, ItemInstance> createDroppedPickupItem)",
"public void SetDroppedPickupItemFactory(Func<AetheriaRuntimeLoadoutItemCommit, ItemInstance> createDroppedPickupItem)",
"public void RestoreDroppedPickupsFromZoneRender(AetheriaRuntimeZoneRenderDocument render)",
"_createDroppedPickupItem?.Invoke(pickup.Item)",
"AetheriaRuntimeDroppedPickupCommit",

View file

@ -322,7 +322,7 @@ Assert-NotContains $actionGameManager "private static AetheriaRuntimeCatalogSnap
Assert-NotContains $actionGameManager "FindTypedRuntimeItem(" "ActionGameManager must not own runtime catalog item lookup policy."
Assert-NotContains $actionGameManager "ArticulatedWeaponBehaviorKinds" "ActionGameManager must not own weapon presentation policy."
Assert-Contains $actionGameManager "ItemManager = boot.ItemManager;" "ActionGameManager should receive ItemManager from the gameplay boot shell."
Assert-Contains $actionGameManager "_loadoutItemProjector = boot.LoadoutItemProjector;" "ActionGameManager should receive loadout projector from the gameplay boot shell."
Assert-Contains $actionGameManager "_loadoutItemFactory = boot.LoadoutItemFactory;" "ActionGameManager should receive loadout item factory from the gameplay boot shell."
Assert-Contains $gameplayBootShell "public sealed class AetheriaUnityGameplayBootShell" "Unity runtime boot/catalog setup should live outside ActionGameManager."
Assert-Contains $gameplayBootShell "AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory)" "Gameplay boot shell should inspect the runtime target."
Assert-Contains $gameplayBootShell "AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)" "Gameplay boot shell should resolve the typed runtime client with the inspected Verse runtime id."
@ -332,8 +332,8 @@ Assert-Contains $gameplayBootShell ".Catalog" "Gameplay boot shell should read t
Assert-Contains $gameplayBootShell ".Latest()" "Gameplay boot shell should read the latest typed runtime catalog snapshot."
Assert-NotContains $gameplayBootShell ".OpenRuntimeCatalog()" "Gameplay boot shell should not use the transitional runtime catalog helper."
Assert-Contains $gameplayBootShell "new ItemManager(" "Gameplay boot shell should construct the Unity item adapter."
Assert-Contains $gameplayBootShell "new AetheriaUnityLoadoutItemProjector(itemManager, runtimeCatalog)" "Gameplay boot shell should construct the loadout item projector."
Assert-Contains $gameplayBootShell "ZoneRenderer.SetDroppedPickupItemProjector(loadoutItemProjector.CreateLoadoutItem)" "Gameplay boot shell should configure dropped pickup projection."
Assert-Contains $gameplayBootShell "new AetheriaUnityLoadoutItemFactory(itemManager, runtimeCatalog)" "Gameplay boot shell should construct the loadout item factory."
Assert-Contains $gameplayBootShell "ZoneRenderer.SetDroppedPickupItemFactory(loadoutItemFactory.CreateLoadoutItem)" "Gameplay boot shell should configure dropped pickup factory binding."
Assert-Contains $gameplayBootShell "ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections" "Gameplay boot shell should configure renderer body settings."
Assert-Contains $gameplayBootShell "AetheriaUnityRenderSettingsBridge.Build(" "Gameplay boot shell should configure daemon render settings."
Assert-Contains $gameplayBootShell "CockpitHudShell.SetRenderSettings(ZoneRenderer.RenderSettings)" "Gameplay boot shell should configure cockpit HUD render settings."
@ -355,7 +355,7 @@ Assert-NotContains $actionGameManager "private void UpdateTargetPanel(Entity tar
Assert-NotContains $actionGameManager "AetheriaRuntimeStateBoot.Inspect(" "ActionGameManager must not inspect runtime targets directly."
Assert-NotContains $actionGameManager "ResolveClient(stateBoot.StateFilePath).OpenRuntimeCatalog()" "ActionGameManager must not open runtime catalogs directly."
Assert-NotContains $actionGameManager "ItemManager = new ItemManager(" "ActionGameManager must not construct ItemManager directly."
Assert-NotContains $actionGameManager "ZoneRenderer.SetDroppedPickupItemProjector(" "ActionGameManager must not configure renderer pickup projection directly."
Assert-NotContains $actionGameManager "ZoneRenderer.SetDroppedPickupItemFactory(" "ActionGameManager must not configure renderer pickup factory binding directly."
Assert-NotContains $actionGameManager "ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections" "ActionGameManager must not configure renderer body settings directly."
Assert-Contains $observedFrameApplier ".Aetheria()" "Unity observed frame application must enter state through the semantic Aetheria facade."
Assert-Contains $observedFrameApplier ".ZoneRender" "Unity observed frame application must consume the typed zone-render document handle."

View file

@ -43,7 +43,7 @@ public class ActionGameManager : MonoBehaviour
_observedEntityIndex,
ItemManager,
EntityConstructionBlueprintProjector.ProjectObservedEntity,
_loadoutItemProjector.CreateLoadoutItem,
_loadoutItemFactory.CreateLoadoutItem,
Debug.LogWarning);
private AetheriaUnityObservedZoneContextProjector ObservedZoneContextProjector =>
_observedZoneContextProjector ??= new AetheriaUnityObservedZoneContextProjector(
@ -107,7 +107,7 @@ public class ActionGameManager : MonoBehaviour
entity => CurrentEntityBinder.RestoreBinding(entity),
Debug.LogWarning);
private AetheriaUnityEntityConstructionBlueprintProjector EntityConstructionBlueprintProjector =>
_entityConstructionBlueprintProjector ??= new AetheriaUnityEntityConstructionBlueprintProjector(_loadoutItemProjector);
_entityConstructionBlueprintProjector ??= new AetheriaUnityEntityConstructionBlueprintProjector(_loadoutItemFactory);
private AetheriaUnityActionBarBindingAdapter ActionBarBindings =>
_actionBarBindingAdapter ??= new AetheriaUnityActionBarBindingAdapter(_actionBarPresentation);
private AetheriaUnityMenuShell MenuShell =>
@ -291,7 +291,7 @@ public class ActionGameManager : MonoBehaviour
}
private ItemManager ItemManager { get; set; }
private AetheriaUnityLoadoutItemProjector _loadoutItemProjector;
private AetheriaUnityLoadoutItemFactory _loadoutItemFactory;
private Galaxy ObservedGalaxy { get; set; }
private Zone Zone { get; set; }
@ -323,7 +323,7 @@ public class ActionGameManager : MonoBehaviour
{
var boot = GameplayBootShell.Boot();
ItemManager = boot.ItemManager;
_loadoutItemProjector = boot.LoadoutItemProjector;
_loadoutItemFactory = boot.LoadoutItemFactory;
ObservedGalaxy = boot.ObservedGalaxy;
SceneWiring.ConfigureCurrentEntityPresentation(_currentEntityPresentation, boot.RuntimeCatalog);
SceneWiring.ConfigureTargetPresentation(

View file

@ -10,12 +10,12 @@ using Unity.Mathematics;
public sealed class AetheriaUnityEntityConstructionBlueprintProjector
{
private readonly AetheriaUnityLoadoutItemProjector _loadoutItemProjector;
private readonly AetheriaUnityLoadoutItemFactory _loadoutItemFactory;
public AetheriaUnityEntityConstructionBlueprintProjector(
AetheriaUnityLoadoutItemProjector loadoutItemProjector)
AetheriaUnityLoadoutItemFactory loadoutItemFactory)
{
_loadoutItemProjector = loadoutItemProjector ?? throw new ArgumentNullException(nameof(loadoutItemProjector));
_loadoutItemFactory = loadoutItemFactory ?? throw new ArgumentNullException(nameof(loadoutItemFactory));
}
public EntityConstructionBlueprint ProjectTemplate(AetheriaRuntimeLoadoutTemplateSnapshot template)
@ -137,7 +137,7 @@ public sealed class AetheriaUnityEntityConstructionBlueprintProjector
{
return (bays ?? Array.Empty<AetheriaRuntimeCargoBayLoadoutSnapshot>())
.Select(bay => (bay.Items ?? Array.Empty<AetheriaRuntimeLoadoutItemSlotSnapshot>())
.Select(slot => (position: new int2(slot.X, slot.Y), item: _loadoutItemProjector.CreateLoadoutItem(slot.Item)))
.Select(slot => (position: new int2(slot.X, slot.Y), item: _loadoutItemFactory.CreateLoadoutItem(slot.Item)))
.Where(slot => slot.item != null)
.ToArray())
.ToArray();
@ -145,7 +145,7 @@ public sealed class AetheriaUnityEntityConstructionBlueprintProjector
private EquippableItem CreateEquippableItem(AetheriaRuntimeLoadoutItemSnapshot item)
{
var instance = _loadoutItemProjector.CreateLoadoutItem(item) as EquippableItem;
var instance = _loadoutItemFactory.CreateLoadoutItem(item) as EquippableItem;
if (instance != null && item.Durability > 0)
instance.Durability = (float)item.Durability;
return instance;

View file

@ -62,8 +62,8 @@ public sealed class AetheriaUnityGameplayBootShell
runtimeCatalog,
Settings.GameplaySettings,
message => Log?.Invoke(message));
var loadoutItemProjector = new AetheriaUnityLoadoutItemProjector(itemManager, runtimeCatalog);
ZoneRenderer.SetDroppedPickupItemProjector(loadoutItemProjector.CreateLoadoutItem);
var loadoutItemFactory = new AetheriaUnityLoadoutItemFactory(itemManager, runtimeCatalog);
ZoneRenderer.SetDroppedPickupItemFactory(loadoutItemFactory.CreateLoadoutItem);
ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections;
ZoneRenderer.RenderSettings = AetheriaUnityRenderSettingsBridge.Build(
Settings,
@ -78,7 +78,7 @@ public sealed class AetheriaUnityGameplayBootShell
runtimeCatalog,
observedGalaxy,
itemManager,
loadoutItemProjector);
loadoutItemFactory);
}
private AetheriaRuntimeStateBootReport SyncRemoteReplicaBeforeBoot(AetheriaRuntimeStateBootReport stateBoot)
@ -123,16 +123,16 @@ public readonly struct AetheriaUnityGameplayBootResult
AetheriaRuntimeCatalogSnapshot runtimeCatalog,
Galaxy observedGalaxy,
ItemManager itemManager,
AetheriaUnityLoadoutItemProjector loadoutItemProjector)
AetheriaUnityLoadoutItemFactory loadoutItemFactory)
{
RuntimeCatalog = runtimeCatalog;
ObservedGalaxy = observedGalaxy;
ItemManager = itemManager;
LoadoutItemProjector = loadoutItemProjector;
LoadoutItemFactory = loadoutItemFactory;
}
public AetheriaRuntimeCatalogSnapshot RuntimeCatalog { get; }
public Galaxy ObservedGalaxy { get; }
public ItemManager ItemManager { get; }
public AetheriaUnityLoadoutItemProjector LoadoutItemProjector { get; }
public AetheriaUnityLoadoutItemFactory LoadoutItemFactory { get; }
}

View file

@ -5,12 +5,12 @@
using System;
using GameCult.Aetheria.State.Verse;
public sealed class AetheriaUnityLoadoutItemProjector
public sealed class AetheriaUnityLoadoutItemFactory
{
private readonly ItemManager _itemManager;
private readonly AetheriaRuntimeCatalogSnapshot _catalog;
public AetheriaUnityLoadoutItemProjector(
public AetheriaUnityLoadoutItemFactory(
ItemManager itemManager,
AetheriaRuntimeCatalogSnapshot catalog)
{

View file

@ -1106,7 +1106,7 @@ public class ZoneRenderer : MonoBehaviour
_loot.Remove(loot);
}
public void SetDroppedPickupItemProjector(Func<AetheriaRuntimeLoadoutItemCommit, ItemInstance> createDroppedPickupItem)
public void SetDroppedPickupItemFactory(Func<AetheriaRuntimeLoadoutItemCommit, ItemInstance> createDroppedPickupItem)
{
_createDroppedPickupItem = createDroppedPickupItem;
}