Refactor simulation and viewer architecture
This commit is contained in:
53
apps/backend/Contracts/WorldContracts.World.cs
Normal file
53
apps/backend/Contracts/WorldContracts.World.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
namespace SpaceGame.Simulation.Api.Contracts;
|
||||
|
||||
public sealed record WorldSnapshot(
|
||||
string Label,
|
||||
int Seed,
|
||||
long Sequence,
|
||||
int TickIntervalMs,
|
||||
DateTimeOffset GeneratedAtUtc,
|
||||
IReadOnlyList<SystemSnapshot> Systems,
|
||||
IReadOnlyList<SpatialNodeSnapshot> SpatialNodes,
|
||||
IReadOnlyList<LocalBubbleSnapshot> LocalBubbles,
|
||||
IReadOnlyList<ResourceNodeSnapshot> Nodes,
|
||||
IReadOnlyList<StationSnapshot> Stations,
|
||||
IReadOnlyList<ClaimSnapshot> Claims,
|
||||
IReadOnlyList<ConstructionSiteSnapshot> ConstructionSites,
|
||||
IReadOnlyList<MarketOrderSnapshot> MarketOrders,
|
||||
IReadOnlyList<PolicySetSnapshot> Policies,
|
||||
IReadOnlyList<ShipSnapshot> Ships,
|
||||
IReadOnlyList<FactionSnapshot> Factions);
|
||||
|
||||
public sealed record WorldDelta(
|
||||
long Sequence,
|
||||
int TickIntervalMs,
|
||||
DateTimeOffset GeneratedAtUtc,
|
||||
bool RequiresSnapshotRefresh,
|
||||
IReadOnlyList<SimulationEventRecord> Events,
|
||||
IReadOnlyList<SpatialNodeDelta> SpatialNodes,
|
||||
IReadOnlyList<LocalBubbleDelta> LocalBubbles,
|
||||
IReadOnlyList<ResourceNodeDelta> Nodes,
|
||||
IReadOnlyList<StationDelta> Stations,
|
||||
IReadOnlyList<ClaimDelta> Claims,
|
||||
IReadOnlyList<ConstructionSiteDelta> ConstructionSites,
|
||||
IReadOnlyList<MarketOrderDelta> MarketOrders,
|
||||
IReadOnlyList<PolicySetDelta> Policies,
|
||||
IReadOnlyList<ShipDelta> Ships,
|
||||
IReadOnlyList<FactionDelta> Factions,
|
||||
ObserverScope? Scope = null);
|
||||
|
||||
public sealed record SimulationEventRecord(
|
||||
string EntityKind,
|
||||
string EntityId,
|
||||
string Kind,
|
||||
string Message,
|
||||
DateTimeOffset OccurredAtUtc,
|
||||
string Family = "simulation",
|
||||
string ScopeKind = "universe",
|
||||
string? ScopeEntityId = null,
|
||||
string Visibility = "public");
|
||||
|
||||
public sealed record ObserverScope(
|
||||
string ScopeKind,
|
||||
string? SystemId = null,
|
||||
string? BubbleId = null);
|
||||
Reference in New Issue
Block a user