Rename inventory dropdown surface model
This commit is contained in:
parent
3616b6a2df
commit
7ca551c684
4 changed files with 24 additions and 22 deletions
|
|
@ -6262,18 +6262,18 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
var requiredSymbols = new[]
|
||||
{
|
||||
"RenderDropdownSurface(",
|
||||
"ProjectDropdownSurface(",
|
||||
"_dropdownSurfaceProjection = ProjectDropdownSurface();",
|
||||
"ComposeDropdownSurface(",
|
||||
"_dropdownSurfaceModel = ComposeDropdownSurface();",
|
||||
"HandleDropdownSurfaceCommand(",
|
||||
"ExecuteDropdownSelection(",
|
||||
"AetheriaEveUnitySurfaceHost.RenderRuntime(",
|
||||
"AetheriaEveUnitySurfaceHost.Hide(_dropdownSurfaceDocument)",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceBuilder.Build(_dropdownSurfaceProjection.State)",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceBuilder.Project(",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceBuilder.Build(_dropdownSurfaceModel.State)",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceBuilder.Compose(",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceCommands.TryRead(request, out var command)",
|
||||
"AetheriaRuntimeInventoryDropdownCommandKind.Close",
|
||||
"AetheriaRuntimeInventoryDropdownCommandKind.Select",
|
||||
"_dropdownSurfaceProjection?.TryResolve(command.Command, out var selection) == true",
|
||||
"_dropdownSurfaceModel?.TryResolve(command.Command, out var selection) == true",
|
||||
"AetheriaRuntimeInventoryDropdownSelectionKind.EntityBay",
|
||||
"AetheriaRuntimeInventoryDropdownSelectionKind.Loadout",
|
||||
"new AetheriaRuntimeInventoryDropdownEntityOption(",
|
||||
|
|
@ -6324,6 +6324,8 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
"private readonly Dictionary<string, Action> _dropdownCommands",
|
||||
"BuildDropdownCommands(",
|
||||
"ProjectDropdownSurfaceState(",
|
||||
"ProjectDropdownSurface(",
|
||||
"_dropdownSurfaceProjection",
|
||||
"GameManager.DockingBay",
|
||||
"GameManager.AvailableEntities()",
|
||||
"GameManager.LoadoutTemplates"
|
||||
|
|
@ -6397,10 +6399,10 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
"AetheriaRuntimeInventoryDropdownBayOption",
|
||||
"AetheriaRuntimeInventoryDropdownLoadoutOption",
|
||||
"AetheriaRuntimeInventoryDropdownSelectionKind",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceProjection",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceModel",
|
||||
"public string EntityKey { get; }",
|
||||
"entityKey: entity.EntityKey",
|
||||
"public static AetheriaRuntimeInventoryDropdownSurfaceProjection Project(",
|
||||
"public static AetheriaRuntimeInventoryDropdownSurfaceModel Compose(",
|
||||
"public bool TryResolve(",
|
||||
"public static string EntityEquipmentCommand(",
|
||||
"public static string EntityBayCommand(",
|
||||
|
|
@ -6408,7 +6410,7 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
"public static string LoadoutCommand(",
|
||||
"public static AetheriaRuntimeSurfaceDocument Build(",
|
||||
"providerKind: \"inventory.panel\"",
|
||||
"The observing client projects available inventory navigation; the shared runtime surface owns the dropdown contract."
|
||||
"The observing client lists available inventory navigation; the shared runtime surface owns the dropdown contract."
|
||||
};
|
||||
var missingBuilderSymbols = requiredBuilderSymbols
|
||||
.Where(symbol => !inventoryDropdownSurfaceBuilder.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
|
|||
|
|
@ -118,12 +118,12 @@ Assert-NotContains $inventoryPanel "ObservedLoadoutTemplates" "InventoryPanel mu
|
|||
Assert-NotContains $inventoryPanel "CreateEntityConstructionBlueprint" "InventoryPanel loadout restore validity must not depend on Unity construction blueprints."
|
||||
Assert-NotContains $inventoryPanel "DockedEntity" "InventoryPanel must not target loadout restore through ActionGameManager.DockedEntity."
|
||||
Assert-NotMatches $inventoryPanel "ExecuteDropdownSelection[\s\S]*?TryGetObservedDockingBay[\s\S]*?private void HideDropdownSurface" "InventoryPanel dropdown selection must not read manager docking-bay identity directly."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceProjection ProjectDropdownSurface\(\)[\s\S]*?TryGetObservedDockingBay[\s\S]*?private void Update" "InventoryPanel dropdown projection must not read manager docking-bay identity directly."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceProjection ProjectDropdownSurface\(\)[\s\S]*?TryGetTypedCurrentDockingBayFacade[\s\S]*?private void Update" "InventoryPanel dropdown projection must use typed docking state, not Unity docking-bay facade objects."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceModel ComposeDropdownSurface\(\)[\s\S]*?TryGetObservedDockingBay[\s\S]*?private void Update" "InventoryPanel dropdown model must not read manager docking-bay identity directly."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceModel ComposeDropdownSurface\(\)[\s\S]*?TryGetTypedCurrentDockingBayFacade[\s\S]*?private void Update" "InventoryPanel dropdown model must use typed docking state, not Unity docking-bay facade objects."
|
||||
Assert-NotMatches $inventoryPanel "private bool IsDisplayedEntityKey\([^)]*\)[\s\S]*?TryResolveEntityRecordKey[\s\S]*?private bool IsDisplayedCargoBayKey" "InventoryPanel displayed entity checks must use cached typed identity."
|
||||
Assert-NotMatches $inventoryPanel "private bool IsDisplayedCargoBayKey\([^)]*\)[\s\S]*?TryResolveCargoBay[\s\S]*?private bool TryResolveCargoBay" "InventoryPanel displayed cargo checks must use cached typed identity."
|
||||
Assert-NotMatches $inventoryPanel "ExecuteDropdownSelection[\s\S]*?ObservedAvailableEntities[\s\S]*?private void HideDropdownSurface" "InventoryPanel dropdown selection must resolve options from typed station-refit keys."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceProjection ProjectDropdownSurface\(\)[\s\S]*?ObservedAvailableEntities[\s\S]*?private void Update" "InventoryPanel dropdown projection must use typed station-refit options."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceModel ComposeDropdownSurface\(\)[\s\S]*?ObservedAvailableEntities[\s\S]*?private void Update" "InventoryPanel dropdown model must use typed station-refit options."
|
||||
|
||||
$inventoryDropdownSurface = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeInventoryDropdownSurfaceBuilder.cs"
|
||||
Assert-Contains $inventoryDropdownSurface "public string EntityKey { get; }" "Inventory dropdown surface selections must carry typed entity identity."
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
Array.Empty<AetheriaRuntimeStationRefitEntityOption>();
|
||||
private AetheriaRuntimeStationLoadoutRestoreOption[] _dropdownStationRefitLoadouts =
|
||||
Array.Empty<AetheriaRuntimeStationLoadoutRestoreOption>();
|
||||
private AetheriaRuntimeInventoryDropdownSurfaceProjection _dropdownSurfaceProjection;
|
||||
private AetheriaRuntimeInventoryDropdownSurfaceModel _dropdownSurfaceModel;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _dropdownSurfaceChrome = new AetheriaEveUnitySurfaceChrome
|
||||
{
|
||||
RootAlignItems = UIE.Align.FlexStart,
|
||||
|
|
@ -214,13 +214,13 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
|
||||
private void RenderDropdownSurface()
|
||||
{
|
||||
_dropdownSurfaceProjection = ProjectDropdownSurface();
|
||||
_dropdownSurfaceModel = ComposeDropdownSurface();
|
||||
|
||||
_dropdownSurfaceDocument = AetheriaEveUnitySurfaceHost.RenderRuntime(
|
||||
transform,
|
||||
_dropdownSurfaceDocument,
|
||||
"Aetheria Inventory Dropdown Surface",
|
||||
AetheriaRuntimeInventoryDropdownSurfaceBuilder.Build(_dropdownSurfaceProjection.State),
|
||||
AetheriaRuntimeInventoryDropdownSurfaceBuilder.Build(_dropdownSurfaceModel.State),
|
||||
HandleDropdownSurfaceCommand,
|
||||
_dropdownSurfaceChrome);
|
||||
}
|
||||
|
|
@ -240,7 +240,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
}
|
||||
|
||||
if (command.Kind == AetheriaRuntimeInventoryDropdownCommandKind.Select &&
|
||||
_dropdownSurfaceProjection?.TryResolve(command.Command, out var selection) == true)
|
||||
_dropdownSurfaceModel?.TryResolve(command.Command, out var selection) == true)
|
||||
{
|
||||
ExecuteDropdownSelection(selection);
|
||||
HideDropdownSurface();
|
||||
|
|
@ -298,7 +298,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
AetheriaEveUnitySurfaceHost.Hide(_dropdownSurfaceDocument);
|
||||
}
|
||||
|
||||
private AetheriaRuntimeInventoryDropdownSurfaceProjection ProjectDropdownSurface()
|
||||
private AetheriaRuntimeInventoryDropdownSurfaceModel ComposeDropdownSurface()
|
||||
{
|
||||
var stationRefit = ResolveStationRefit();
|
||||
_dropdownStationRefitEntities = (stationRefit?.AvailableEntities ?? Array.Empty<AetheriaRuntimeStationRefitEntityOption>())
|
||||
|
|
@ -327,7 +327,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
.ToArray();
|
||||
var hasDockingBay = TryResolveCurrentDockingBayRow(out var currentDockingBay);
|
||||
|
||||
return AetheriaRuntimeInventoryDropdownSurfaceBuilder.Project(
|
||||
return AetheriaRuntimeInventoryDropdownSurfaceBuilder.Compose(
|
||||
Title?.text ?? "None",
|
||||
entityOptions,
|
||||
hasDockingBay,
|
||||
|
|
|
|||
|
|
@ -148,9 +148,9 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public int TemplateIndex { get; }
|
||||
}
|
||||
|
||||
public sealed class AetheriaRuntimeInventoryDropdownSurfaceProjection
|
||||
public sealed class AetheriaRuntimeInventoryDropdownSurfaceModel
|
||||
{
|
||||
public AetheriaRuntimeInventoryDropdownSurfaceProjection(
|
||||
public AetheriaRuntimeInventoryDropdownSurfaceModel(
|
||||
AetheriaRuntimeInventoryDropdownSurfaceState state,
|
||||
IReadOnlyDictionary<string, AetheriaRuntimeInventoryDropdownSelection> selections)
|
||||
{
|
||||
|
|
@ -199,7 +199,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return $"{SurfaceId}.loadout_{templateIndex}";
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeInventoryDropdownSurfaceProjection Project(
|
||||
public static AetheriaRuntimeInventoryDropdownSurfaceModel Compose(
|
||||
string currentView,
|
||||
IEnumerable<AetheriaRuntimeInventoryDropdownEntityOption> entities,
|
||||
bool hasDockingBay,
|
||||
|
|
@ -334,7 +334,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
loadoutOptions));
|
||||
}
|
||||
|
||||
return new AetheriaRuntimeInventoryDropdownSurfaceProjection(
|
||||
return new AetheriaRuntimeInventoryDropdownSurfaceModel(
|
||||
new AetheriaRuntimeInventoryDropdownSurfaceState(
|
||||
currentView,
|
||||
groups,
|
||||
|
|
@ -362,7 +362,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
string.IsNullOrWhiteSpace(state.CurrentView) ? "None" : state.CurrentView),
|
||||
Text(
|
||||
$"{SurfaceId}.note",
|
||||
"The observing client projects available inventory navigation; the shared runtime surface owns the dropdown contract."))
|
||||
"The observing client lists available inventory navigation; the shared runtime surface owns the dropdown contract."))
|
||||
};
|
||||
|
||||
foreach (var group in state.Groups)
|
||||
|
|
|
|||
Loading…
Reference in a new issue