From ae9ddf43bd548255399426c46e94448743b26d84 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 28 Jun 2026 15:38:59 +0100 Subject: [PATCH] Rename trade interaction surface models --- Aetheria.State.Verify/Program.cs | 34 +++++++++++-------- Assets/Scripts/UI/Menu/TradeMenu.cs | 20 +++++------ ...iaRuntimeTradeInteractionSurfaceBuilder.cs | 20 +++++------ 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index a34428433..2510647e8 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -5808,22 +5808,22 @@ static void RequireTradeFilterAndRowActionsUseEveSurface(string root) var requiredSymbols = new[] { "RenderFilterSurface(", - "_filterSurfaceProjection = ProjectTradeFilterSurface();", + "_filterSurfaceModel = ComposeTradeFilterSurface();", "HandleFilterSurfaceCommand(", "AetheriaEveUnitySurfaceHost.RenderRuntime(", "AetheriaEveUnitySurfaceHost.Hide(_filterSurfaceDocument)", - "AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildFilter(_filterSurfaceProjection.State)", - "ProjectTradeFilterSurface(", - "AetheriaRuntimeTradeInteractionSurfaceBuilder.ProjectFilters(", - "_filterSurfaceProjection?.TryResolve(command.Command, out var selection) == true", + "AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildFilter(_filterSurfaceModel.State)", + "ComposeTradeFilterSurface(", + "AetheriaRuntimeTradeInteractionSurfaceBuilder.ComposeFilters(", + "_filterSurfaceModel?.TryResolve(command.Command, out var selection) == true", "ExecuteTradeFilterSelection(", "new AetheriaRuntimeTradeFilterOption(", "RenderRowActionSurface(", "HandleRowActionSurfaceCommand(", "AetheriaEveUnitySurfaceHost.Hide(_rowActionSurfaceDocument)", - "AetheriaRuntimeTradeInteractionSurfaceBuilder.ProjectRowActions(", - "AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildRowActions(_rowActionSurfaceProjection.State)", - "_rowActionSurfaceProjection?.TryResolve(command.Command, out var selection) == true", + "AetheriaRuntimeTradeInteractionSurfaceBuilder.ComposeRowActions(", + "AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildRowActions(_rowActionSurfaceModel.State)", + "_rowActionSurfaceModel?.TryResolve(command.Command, out var selection) == true", "new AetheriaRuntimeTradeRowActionOption(index, action.Label)", "ShowBuyQuantityDialog(", "AetheriaRuntimeTradeInteractionSurfaceCommands.TryReadFilter(request, out var command)", @@ -5865,14 +5865,18 @@ static void RequireTradeFilterAndRowActionsUseEveSurface(string root) "string.Equals(request.Command, AetheriaRuntimeTradeInteractionSurfaceBuilder.CloseFilter", "string.Equals(request.Command, AetheriaRuntimeTradeInteractionSurfaceBuilder.CloseRowAction", "_filterSurfaceCommands.TryGetValue(request.Command", + "_filterSurfaceProjection", "private readonly Dictionary _filterSurfaceCommands", "BuildFilterSurfaceCommands(", "ProjectTradeFilterSurfaceState(", + "ProjectTradeFilterSurface(", "AddTradeFilterGroup(", "_rowActionSurfaceCommands.TryGetValue(request.Command", + "_rowActionSurfaceProjection", "private readonly Dictionary _rowActionSurfaceCommands", "BuildRowActionSurfaceCommands(", - "ProjectTradeRowActionSurfaceState(" + "ProjectTradeRowActionSurfaceState(", + "ProjectRowActions(" }; var hits = forbiddenSymbols @@ -5902,22 +5906,24 @@ static void RequireTradeFilterAndRowActionsUseEveSurface(string root) "AetheriaRuntimeTradeFilterOption", "AetheriaRuntimeTradeFilterSelectionKind", "AetheriaRuntimeTradeFilterSelection", - "AetheriaRuntimeTradeFilterSurfaceProjection", + "AetheriaRuntimeTradeFilterSurfaceModel", "AetheriaRuntimeTradeRowActionSurfaceState", "AetheriaRuntimeTradeRowActionOption", "AetheriaRuntimeTradeRowActionSelection", - "AetheriaRuntimeTradeRowActionSurfaceProjection", + "AetheriaRuntimeTradeRowActionSurfaceModel", "AetheriaRuntimeTradeSurfaceGroup", "AetheriaRuntimeTradeSurfaceOption", "public static string HardpointFilterCommand(", "public static string RowActionCommand(", - "public static AetheriaRuntimeTradeFilterSurfaceProjection ProjectFilters(", + "public static AetheriaRuntimeTradeFilterSurfaceModel ComposeFilters(", "public bool TryResolve(string command, out AetheriaRuntimeTradeFilterSelection selection)", - "public static AetheriaRuntimeTradeRowActionSurfaceProjection ProjectRowActions(", + "public static AetheriaRuntimeTradeRowActionSurfaceModel ComposeRowActions(", "public bool TryResolve(string command, out AetheriaRuntimeTradeRowActionSelection selection)", "public static AetheriaRuntimeSurfaceDocument BuildFilter(", "public static AetheriaRuntimeSurfaceDocument BuildRowActions(", - "providerKind: \"trade.menu\"" + "providerKind: \"trade.menu\"", + "The observing client lists available trade filters; the shared runtime surface owns the filter selector contract.", + "The observing client lists available row actions; the shared runtime surface owns the row action contract." }; var missingBuilderSymbols = requiredBuilderSymbols .Where(symbol => !tradeInteractionSurfaceBuilder.Contains(symbol, StringComparison.Ordinal)) diff --git a/Assets/Scripts/UI/Menu/TradeMenu.cs b/Assets/Scripts/UI/Menu/TradeMenu.cs index 05c9e3f86..2b2e3ffae 100644 --- a/Assets/Scripts/UI/Menu/TradeMenu.cs +++ b/Assets/Scripts/UI/Menu/TradeMenu.cs @@ -47,9 +47,9 @@ public class TradeMenu : MonoBehaviour private AetheriaRuntimeStationCargoTargetRow[] _cargoSelectorStationRefitTargets = Array.Empty(); private AetheriaRuntimeStationRefitDocument _stationRefit; - private AetheriaRuntimeTradeFilterSurfaceProjection _filterSurfaceProjection; + private AetheriaRuntimeTradeFilterSurfaceModel _filterSurfaceModel; private Action[] _rowActionCallbacks = Array.Empty(); - private AetheriaRuntimeTradeRowActionSurfaceProjection _rowActionSurfaceProjection; + private AetheriaRuntimeTradeRowActionSurfaceModel _rowActionSurfaceModel; public EquippedCargoBay Inventory { get; set; } @@ -766,13 +766,13 @@ public class TradeMenu : MonoBehaviour private void RenderFilterSurface() { - _filterSurfaceProjection = ProjectTradeFilterSurface(); + _filterSurfaceModel = ComposeTradeFilterSurface(); _filterSurfaceDocument = AetheriaEveUnitySurfaceHost.RenderRuntime( transform, _filterSurfaceDocument, "Aetheria Trade Filter Surface", - AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildFilter(_filterSurfaceProjection.State), + AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildFilter(_filterSurfaceModel.State), HandleFilterSurfaceCommand, _filterSurfaceChrome, sortingOrder: 1001); @@ -793,7 +793,7 @@ public class TradeMenu : MonoBehaviour } if (command.Kind == AetheriaRuntimeTradeInteractionCommandKind.Select && - _filterSurfaceProjection?.TryResolve(command.Command, out var selection) == true) + _filterSurfaceModel?.TryResolve(command.Command, out var selection) == true) { ExecuteTradeFilterSelection(selection); HideFilterSurface(); @@ -811,7 +811,7 @@ public class TradeMenu : MonoBehaviour AetheriaEveUnitySurfaceHost.Hide(_filterSurfaceDocument); } - private AetheriaRuntimeTradeFilterSurfaceProjection ProjectTradeFilterSurface() + private AetheriaRuntimeTradeFilterSurfaceModel ComposeTradeFilterSurface() { var options = new List(); options.AddRange(((HardpointType[])Enum.GetValues(typeof(HardpointType))) @@ -856,7 +856,7 @@ public class TradeMenu : MonoBehaviour "Maximum Size")); } - return AetheriaRuntimeTradeInteractionSurfaceBuilder.ProjectFilters( + return AetheriaRuntimeTradeInteractionSurfaceBuilder.ComposeFilters( BuildFilterSummary(), options, DateTime.UtcNow.ToString("O")); @@ -906,7 +906,7 @@ public class TradeMenu : MonoBehaviour _rowActionCallbacks = actions .Select(action => action.Action) .ToArray(); - _rowActionSurfaceProjection = AetheriaRuntimeTradeInteractionSurfaceBuilder.ProjectRowActions( + _rowActionSurfaceModel = AetheriaRuntimeTradeInteractionSurfaceBuilder.ComposeRowActions( title, actions.Select((action, index) => new AetheriaRuntimeTradeRowActionOption(index, action.Label)), DateTime.UtcNow.ToString("O")); @@ -915,7 +915,7 @@ public class TradeMenu : MonoBehaviour transform, _rowActionSurfaceDocument, "Aetheria Trade Row Action Surface", - AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildRowActions(_rowActionSurfaceProjection.State), + AetheriaRuntimeTradeInteractionSurfaceBuilder.BuildRowActions(_rowActionSurfaceModel.State), HandleRowActionSurfaceCommand, _rowActionSurfaceChrome, sortingOrder: 1002); @@ -936,7 +936,7 @@ public class TradeMenu : MonoBehaviour } if (command.Kind == AetheriaRuntimeTradeInteractionCommandKind.Select && - _rowActionSurfaceProjection?.TryResolve(command.Command, out var selection) == true && + _rowActionSurfaceModel?.TryResolve(command.Command, out var selection) == true && selection.Index >= 0 && selection.Index < _rowActionCallbacks.Length) { diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeTradeInteractionSurfaceBuilder.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeTradeInteractionSurfaceBuilder.cs index 7f9464c02..8d57a392f 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeTradeInteractionSurfaceBuilder.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeTradeInteractionSurfaceBuilder.cs @@ -98,9 +98,9 @@ namespace GameCult.Aetheria.State.Verse public string Token { get; } } - public sealed class AetheriaRuntimeTradeFilterSurfaceProjection + public sealed class AetheriaRuntimeTradeFilterSurfaceModel { - public AetheriaRuntimeTradeFilterSurfaceProjection( + public AetheriaRuntimeTradeFilterSurfaceModel( AetheriaRuntimeTradeFilterSurfaceState state, IReadOnlyDictionary selections) { @@ -161,9 +161,9 @@ namespace GameCult.Aetheria.State.Verse public int Index { get; } } - public sealed class AetheriaRuntimeTradeRowActionSurfaceProjection + public sealed class AetheriaRuntimeTradeRowActionSurfaceModel { - public AetheriaRuntimeTradeRowActionSurfaceProjection( + public AetheriaRuntimeTradeRowActionSurfaceModel( AetheriaRuntimeTradeRowActionSurfaceState state, IReadOnlyDictionary selections) { @@ -225,7 +225,7 @@ namespace GameCult.Aetheria.State.Verse return $"{RowActionSurfaceId}.action_{index}"; } - public static AetheriaRuntimeTradeFilterSurfaceProjection ProjectFilters( + public static AetheriaRuntimeTradeFilterSurfaceModel ComposeFilters( string filterSummary, IEnumerable options, string updatedAtUtc) @@ -270,7 +270,7 @@ namespace GameCult.Aetheria.State.Verse .Where(group => group.Options.Count > 0) .ToArray(); - return new AetheriaRuntimeTradeFilterSurfaceProjection( + return new AetheriaRuntimeTradeFilterSurfaceModel( new AetheriaRuntimeTradeFilterSurfaceState( filterSummary, groups, @@ -278,7 +278,7 @@ namespace GameCult.Aetheria.State.Verse selections); } - public static AetheriaRuntimeTradeRowActionSurfaceProjection ProjectRowActions( + public static AetheriaRuntimeTradeRowActionSurfaceModel ComposeRowActions( string title, IEnumerable actions, string updatedAtUtc) @@ -302,7 +302,7 @@ namespace GameCult.Aetheria.State.Verse selections[command] = new AetheriaRuntimeTradeRowActionSelection(command, action.Index); } - return new AetheriaRuntimeTradeRowActionSurfaceProjection( + return new AetheriaRuntimeTradeRowActionSurfaceModel( new AetheriaRuntimeTradeRowActionSurfaceState( title, options, @@ -326,7 +326,7 @@ namespace GameCult.Aetheria.State.Verse "Trade Filters", Text( $"{FilterSurfaceId}.note", - "The observing client projects available trade filters; the shared runtime surface owns the filter selector contract."), + "The observing client lists available trade filters; the shared runtime surface owns the filter selector contract."), Text($"{FilterSurfaceId}.active", state.FilterSummary)) }; @@ -398,7 +398,7 @@ namespace GameCult.Aetheria.State.Verse Text($"{RowActionSurfaceId}.title", state.Title), Text( $"{RowActionSurfaceId}.note", - "The observing client projects available row actions; the shared runtime surface owns the row action contract."), + "The observing client lists available row actions; the shared runtime surface owns the row action contract."), ButtonColumn( $"{RowActionSurfaceId}.options", state.Actions