Expose reactive Starbridge state accessors
This commit is contained in:
parent
5523aa4661
commit
c2bda39adc
4 changed files with 85 additions and 5 deletions
|
|
@ -7620,9 +7620,13 @@ static void RequireAetheriaManagedStateAccessorsCoverDomainDocuments(string root
|
|||
"public AetheriaRuntimeGravityViewportDocument LatestGravity(AetheriaRuntimeRtsViewportBounds viewport)",
|
||||
"public AetheriaRuntimeSelectedObjectDocument LatestSelectedObject(int entityIndex)",
|
||||
"public AetheriaRuntimeStarbridgeScenarioDocument LatestScenario()",
|
||||
"public CultMeshReactiveDocument<AetheriaRuntimeStarbridgeScenarioDocument> ReactiveScenario(",
|
||||
"public AetheriaRuntimeStarbridgeSessionDocument LatestSession()",
|
||||
"public CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionDocument> ReactiveSession(",
|
||||
"public AetheriaRuntimeStarbridgeSessionSummaryDocument LatestSummary()",
|
||||
"public AetheriaRuntimeStarbridgePlayerSeatDocument LatestPlayerSeat(string seatId)"
|
||||
"public CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionSummaryDocument> ReactiveSummary(",
|
||||
"public AetheriaRuntimeStarbridgePlayerSeatDocument LatestPlayerSeat(string seatId)",
|
||||
"public CultMeshReactiveDocument<AetheriaRuntimeStarbridgePlayerSeatDocument> ReactivePlayerSeat("
|
||||
};
|
||||
var missingClientSymbols = requiredClientSymbols
|
||||
.Where(symbol => !clientState.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -7700,7 +7704,27 @@ static void RequireAetheriaManagedStateAccessorsCoverDomainDocuments(string root
|
|||
string.Join(", ", offenders));
|
||||
}
|
||||
|
||||
Console.WriteLine("Domain document accessors: managed Aetheria state exposes named latest reads for daemon, viewport, detail, and Starbridge documents");
|
||||
if (!clientState.Contains("Starbridge.Summary", StringComparison.Ordinal) ||
|
||||
!checkedSources["DaemonRuntimeDocumentTests.cs"].Contains(
|
||||
"client.State.Document<AetheriaRuntimeStarbridgeSessionSummaryDocument>()",
|
||||
StringComparison.Ordinal) ||
|
||||
!checkedSources["DaemonRuntimeDocumentTests.cs"].Contains(
|
||||
"client.State.DocumentBySchema(AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary)",
|
||||
StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Starbridge summary must be registered in the managed Aetheria document catalog for typed and schema lookups.");
|
||||
}
|
||||
|
||||
if (!checkedSources["StarbridgePlayerSeatDocumentTests.cs"].Contains(
|
||||
".ReactivePlayerSeat(seat.SeatId)",
|
||||
StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Starbridge player-seat examples must use the named managed reactive accessor instead of fetching the raw document handle.");
|
||||
}
|
||||
|
||||
Console.WriteLine("Domain document accessors: managed Aetheria state exposes named latest/reactive reads for daemon, viewport, detail, and Starbridge documents");
|
||||
}
|
||||
|
||||
static void RequireVerseHostSettingsAuthority(string root)
|
||||
|
|
|
|||
|
|
@ -221,6 +221,12 @@ public class DaemonRuntimeDocumentTests
|
|||
Assert.AreSame(client.State.Current.Entity, client.State.Document<AetheriaRuntimeCurrentEntityDocument>());
|
||||
Assert.AreSame(client.State.Catalog, client.State.Document<AetheriaRuntimeCatalogSnapshot>());
|
||||
Assert.AreSame(client.State.ZoneRender, client.State.Document<AetheriaRuntimeZoneRenderDocument>());
|
||||
Assert.AreSame(
|
||||
client.State.Starbridge.Summary,
|
||||
client.State.Document<AetheriaRuntimeStarbridgeSessionSummaryDocument>());
|
||||
Assert.AreSame(
|
||||
client.State.Starbridge.Summary,
|
||||
client.State.DocumentBySchema(AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary));
|
||||
Assert.AreSame(client.State.LatestFrame, client.State.Document<AetheriaRuntimeDaemonFrameDocument>());
|
||||
Assert.AreSame(client.State.Daemon.LatestFrame, client.State.LatestFrame);
|
||||
Assert.AreSame(client.State.Daemon.LatestSoaView, client.State.LatestSoaView);
|
||||
|
|
|
|||
|
|
@ -81,9 +81,8 @@ public class StarbridgePlayerSeatDocumentTests
|
|||
var aetheriaStarbridge = client
|
||||
.Aetheria()
|
||||
.Starbridge;
|
||||
var aetheriaSeat = aetheriaStarbridge.PlayerSeat(seat.SeatId);
|
||||
using var reactive = handle.Reactive();
|
||||
using var aetheriaReactive = aetheriaSeat.Reactive();
|
||||
using var aetheriaReactive = aetheriaStarbridge.ReactivePlayerSeat(seat.SeatId);
|
||||
|
||||
Assert.AreEqual("seat-support", handle.Latest().SeatId);
|
||||
Assert.AreEqual("seat-support", client.Aetheria().Starbridge.LatestPlayerSeat(seat.SeatId).SeatId);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
SectorMap,
|
||||
ZoneRender,
|
||||
Starbridge.Scenario,
|
||||
Starbridge.Session);
|
||||
Starbridge.Session,
|
||||
Starbridge.Summary);
|
||||
}
|
||||
|
||||
public AetheriaClientDaemonState Daemon { get; }
|
||||
|
|
@ -1187,6 +1188,18 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return LatestScenarioAsync().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public Task<CultMeshReactiveDocument<AetheriaRuntimeStarbridgeScenarioDocument>> ReactiveScenarioAsync(
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return Scenario.ReactiveAsync(options);
|
||||
}
|
||||
|
||||
public CultMeshReactiveDocument<AetheriaRuntimeStarbridgeScenarioDocument> ReactiveScenario(
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return Scenario.Reactive(options);
|
||||
}
|
||||
|
||||
public Task<AetheriaRuntimeStarbridgeSessionDocument> LatestSessionAsync()
|
||||
{
|
||||
return Session.LatestAsync();
|
||||
|
|
@ -1197,6 +1210,18 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return LatestSessionAsync().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public Task<CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionDocument>> ReactiveSessionAsync(
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return Session.ReactiveAsync(options);
|
||||
}
|
||||
|
||||
public CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionDocument> ReactiveSession(
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return Session.Reactive(options);
|
||||
}
|
||||
|
||||
public Task<AetheriaRuntimeStarbridgeSessionSummaryDocument> LatestSummaryAsync()
|
||||
{
|
||||
return Summary.LatestAsync();
|
||||
|
|
@ -1207,6 +1232,18 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return LatestSummaryAsync().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public Task<CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionSummaryDocument>> ReactiveSummaryAsync(
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return Summary.ReactiveAsync(options);
|
||||
}
|
||||
|
||||
public CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionSummaryDocument> ReactiveSummary(
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return Summary.Reactive(options);
|
||||
}
|
||||
|
||||
public Task<AetheriaRuntimeStarbridgePlayerSeatDocument> LatestPlayerSeatAsync(string seatId)
|
||||
{
|
||||
return PlayerSeat(seatId).LatestAsync();
|
||||
|
|
@ -1216,5 +1253,19 @@ namespace GameCult.Aetheria.State.Verse
|
|||
{
|
||||
return LatestPlayerSeatAsync(seatId).ConfigureAwait(false).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public Task<CultMeshReactiveDocument<AetheriaRuntimeStarbridgePlayerSeatDocument>> ReactivePlayerSeatAsync(
|
||||
string seatId,
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return PlayerSeat(seatId).ReactiveAsync(options);
|
||||
}
|
||||
|
||||
public CultMeshReactiveDocument<AetheriaRuntimeStarbridgePlayerSeatDocument> ReactivePlayerSeat(
|
||||
string seatId,
|
||||
CultMeshReactiveDocumentOptions? options = null)
|
||||
{
|
||||
return PlayerSeat(seatId).Reactive(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue