Rename Unity loadout item projector factory
This commit is contained in:
parent
3917be7d86
commit
203fe80c0e
8 changed files with 41 additions and 41 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue