feat(starbridge): publish commander and pilot surfaces
This commit is contained in:
parent
2b276a95b4
commit
fdcff0f2d6
7 changed files with 142 additions and 17 deletions
|
|
@ -9,8 +9,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
{
|
||||
public static class AetheriaRuntimeDaemonGameSurfaceBuilder
|
||||
{
|
||||
public const string SurfaceId = "aetheria.game";
|
||||
public const string TuiSurfaceId = "aetheria.game.tui";
|
||||
public const string PilotSurfaceId = "aetheria.starbridge.pilot";
|
||||
public const string CommanderSurfaceId = "aetheria.starbridge.commander";
|
||||
public const string SurfaceId = PilotSurfaceId;
|
||||
public const string TuiSurfaceId = "aetheria.starbridge.pilot.tui";
|
||||
|
||||
public static AetheriaRuntimeSurfaceDocument Build(
|
||||
AetheriaRuntimeDaemonFrameDocument frame,
|
||||
|
|
@ -126,6 +128,75 @@ namespace GameCult.Aetheria.State.Verse
|
|||
.ToArray());
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeSurfaceDocument BuildCommander(
|
||||
AetheriaRuntimeDaemonFrameDocument frame,
|
||||
AetheriaRuntimeDaemonHealthDocument health,
|
||||
AetheriaRuntimeDaemonCommandBoundaryDocument commandBoundary,
|
||||
AetheriaRuntimeStarbridgeSessionSummaryDocument? starbridge = null)
|
||||
{
|
||||
frame ??= new AetheriaRuntimeDaemonFrameDocument();
|
||||
health ??= new AetheriaRuntimeDaemonHealthDocument();
|
||||
commandBoundary ??= AetheriaRuntimeDaemonCommandBoundaryDocument.Create(frame.DaemonId);
|
||||
starbridge ??= AetheriaRuntimeStarbridgeDocuments.SessionSummary(frame);
|
||||
var run = frame.Run ?? new AetheriaRuntimeRunCheckpointCommit();
|
||||
var zone = FindCurrentZone(run);
|
||||
|
||||
var root = SurfaceRoot(
|
||||
"aetheria.starbridge.commander.root",
|
||||
StrategicWorldSurface("aetheria.starbridge.commander.world", run, zone),
|
||||
BuildStarbridgeStationStockCard(starbridge),
|
||||
BuildStarbridgeWaveForecastCard(starbridge),
|
||||
BuildStarbridgeRuntimeRolesCard(starbridge));
|
||||
|
||||
return new AetheriaRuntimeSurfaceDocument(
|
||||
"aetheria.daemon",
|
||||
"game.daemon",
|
||||
"Starbridge Commander",
|
||||
frame.FrameId,
|
||||
frame.PublishedAtUtc,
|
||||
new AetheriaRuntimeSurfaceTree(
|
||||
CommanderSurfaceId,
|
||||
root,
|
||||
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
|
||||
commandBoundary.Commands
|
||||
.Where(entry => AetheriaRuntimeDaemonSurfaceCommandCatalog.IsArgumentlessCommand(entry.Kind))
|
||||
.Select(entry => new AetheriaRuntimeSurfaceCommandTemplate(
|
||||
AetheriaRuntimeDaemonSurfaceCommandCatalog.CommandName(entry.Kind),
|
||||
AetheriaRuntimeDaemonSurfaceCommandCatalog.Label(entry.Kind),
|
||||
"cultmesh"))
|
||||
.ToArray());
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeSurfaceComponent StrategicWorldSurface(
|
||||
string id,
|
||||
AetheriaRuntimeRunCheckpointCommit run,
|
||||
AetheriaRuntimeZoneSnapshotCommit zone)
|
||||
{
|
||||
var props = new Dictionary<string, string>(StringComparer.Ordinal)
|
||||
{
|
||||
["label"] = string.IsNullOrWhiteSpace(zone.Name) ? "Starbridge" : zone.Name,
|
||||
["statePointerId"] = AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest.ToString(),
|
||||
["assetManifest"] = AetheriaRuntimeVerseRecordKeys.EveAssetCatalog.ToString(),
|
||||
["inputProfile"] = "rts.pointer-keyboard.v1",
|
||||
["cameraRig"] = "rts.top-down.v1",
|
||||
["zoneIndex"] = zone.ZoneIndex.ToString(CultureInfo.InvariantCulture),
|
||||
["runId"] = run.RunId ?? ""
|
||||
};
|
||||
var entities = (zone.Entities ?? Array.Empty<AetheriaRuntimeEntitySnapshotCommit>())
|
||||
.Where(entity => entity != null && entity.IsActive)
|
||||
.Select(entity => PlayableWorldEntity(entity, run, zone, run.CurrentEntityKey))
|
||||
.ToArray();
|
||||
return new AetheriaRuntimeSurfaceComponent(
|
||||
id,
|
||||
"world.scene2d",
|
||||
props,
|
||||
entities,
|
||||
AetheriaRuntimeSurfaceStateBindings.FromProps(props),
|
||||
Array.Empty<AetheriaRuntimeEmbeddedDocumentSlot>(),
|
||||
Layout(("position", "absolute"), ("inset", "0"), ("width", "100%"), ("height", "100%")),
|
||||
new Dictionary<string, string> { ["background"] = "transparent" });
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeSurfaceComponent BuildStarbridgeStationStockCard(
|
||||
AetheriaRuntimeStarbridgeSessionSummaryDocument summary)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -110,7 +110,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimePlayerSettingsCommands.IncrementSignificantDigits,
|
||||
AetheriaRuntimePlayerSettingsCommands.CycleNebulaQuality,
|
||||
AetheriaRuntimePlayerSettingsCommands.ToggleShowAsteroidsInMinimap),
|
||||
Surface(AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, "Aetheria Daemon", AetheriaRuntimeVerseRecordKeys.DaemonGameSurface.ToString(), "player", "Authoritative daemon game surface.", providerId: "aetheria.daemon", providerKind: "game.daemon", transport: "cultmesh-record", surfaceKind: "interactive-world", worldInteraction: WorldInteraction("provider-authored-world-surface"), requiresPlugins: FieldPluginRequirements()),
|
||||
Surface(AetheriaRuntimeDaemonGameSurfaceBuilder.PilotSurfaceId, "Starbridge Pilot", AetheriaRuntimeVerseRecordKeys.DaemonGameSurface.ToString(), "pilot", "Embodied Starbridge pilot projection.", providerId: "aetheria.daemon", providerKind: "game.daemon", transport: "cultmesh-record", surfaceKind: "interactive-world", worldInteraction: WorldInteraction("provider-authored-world-surface"), requiresPlugins: FieldPluginRequirements()),
|
||||
Surface(AetheriaRuntimeDaemonGameSurfaceBuilder.CommanderSurfaceId, "Starbridge Commander", AetheriaRuntimeVerseRecordKeys.StarbridgeCommanderSurface.ToString(), "commander", "Strategic Starbridge commander projection.", providerId: "aetheria.daemon", providerKind: "game.daemon", transport: "cultmesh-record", surfaceKind: "interactive-world", worldInteraction: WorldInteraction("provider-authored-world-surface"), requiresPlugins: FieldPluginRequirements()),
|
||||
Surface(AetheriaRuntimeDaemonGameSurfaceBuilder.TuiSurfaceId, "Aetheria Daemon TUI", AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface.ToString(), "agent", "Compact daemon game surface for dense inspection.", providerId: "aetheria.daemon", providerKind: "game.daemon", transport: "cultmesh-record", surfaceKind: "interactive-world", worldInteraction: WorldInteraction("provider-authored-world-surface")),
|
||||
Surface(AetheriaRuntimeDaemonEditorSurfaceBuilder.SurfaceId, "Aetheria Daemon Editor", AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface.ToString(), "operator", "Daemon editor and surface inventory.", providerId: "aetheria.daemon", providerKind: "editor.daemon", transport: "cultmesh-record", surfaceKind: "interactive-world-editor", worldInteraction: WorldInteraction("provider-authored-world-editor-surface")),
|
||||
Surface(AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, "Aetheria Daemon Editor TUI", AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface.ToString(), "agent", "Compact daemon editor and surface inventory.", providerId: "aetheria.daemon", providerKind: "editor.daemon", transport: "cultmesh-record", surfaceKind: "interactive-world-editor", worldInteraction: WorldInteraction("provider-authored-world-editor-surface")),
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public static CultRecordKey DaemonGameSurface { get; } =
|
||||
new CultRecordKey("eve:surface:aetheria.daemon.game");
|
||||
|
||||
public static CultRecordKey StarbridgeCommanderSurface { get; } =
|
||||
new CultRecordKey("eve:surface:aetheria.starbridge.commander");
|
||||
|
||||
public static CultRecordKey DaemonGameTuiSurface { get; } =
|
||||
new CultRecordKey("eve:surface:aetheria.daemon.game.tui");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue