Refactor simulation and viewer architecture
This commit is contained in:
85
apps/viewer/src/contractsWorld.ts
Normal file
85
apps/viewer/src/contractsWorld.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import type {
|
||||
ClaimDelta,
|
||||
ClaimSnapshot,
|
||||
ConstructionSiteDelta,
|
||||
ConstructionSiteSnapshot,
|
||||
} from "./contractsInfrastructure";
|
||||
import type {
|
||||
FactionDelta,
|
||||
FactionSnapshot,
|
||||
} from "./contractsFactions";
|
||||
import type {
|
||||
LocalBubbleDelta,
|
||||
LocalBubbleSnapshot,
|
||||
ResourceNodeDelta,
|
||||
ResourceNodeSnapshot,
|
||||
SpatialNodeDelta,
|
||||
SpatialNodeSnapshot,
|
||||
SystemSnapshot,
|
||||
} from "./contractsCelestial";
|
||||
import type {
|
||||
MarketOrderDelta,
|
||||
PolicySetDelta,
|
||||
PolicySetSnapshot,
|
||||
MarketOrderSnapshot,
|
||||
} from "./contractsEconomy";
|
||||
import type {
|
||||
ShipDelta,
|
||||
ShipSnapshot,
|
||||
} from "./contractsShips";
|
||||
|
||||
export interface WorldSnapshot {
|
||||
label: string;
|
||||
seed: number;
|
||||
sequence: number;
|
||||
tickIntervalMs: number;
|
||||
generatedAtUtc: string;
|
||||
systems: SystemSnapshot[];
|
||||
spatialNodes: SpatialNodeSnapshot[];
|
||||
localBubbles: LocalBubbleSnapshot[];
|
||||
nodes: ResourceNodeSnapshot[];
|
||||
stations: import("./contractsInfrastructure").StationSnapshot[];
|
||||
claims: ClaimSnapshot[];
|
||||
constructionSites: ConstructionSiteSnapshot[];
|
||||
marketOrders: MarketOrderSnapshot[];
|
||||
policies: PolicySetSnapshot[];
|
||||
ships: ShipSnapshot[];
|
||||
factions: FactionSnapshot[];
|
||||
}
|
||||
|
||||
export interface WorldDelta {
|
||||
sequence: number;
|
||||
tickIntervalMs: number;
|
||||
generatedAtUtc: string;
|
||||
requiresSnapshotRefresh: boolean;
|
||||
events: SimulationEventRecord[];
|
||||
spatialNodes: SpatialNodeDelta[];
|
||||
localBubbles: LocalBubbleDelta[];
|
||||
nodes: ResourceNodeDelta[];
|
||||
stations: import("./contractsInfrastructure").StationDelta[];
|
||||
claims: ClaimDelta[];
|
||||
constructionSites: ConstructionSiteDelta[];
|
||||
marketOrders: MarketOrderDelta[];
|
||||
policies: PolicySetDelta[];
|
||||
ships: ShipDelta[];
|
||||
factions: FactionDelta[];
|
||||
scope?: ObserverScope | null;
|
||||
}
|
||||
|
||||
export interface SimulationEventRecord {
|
||||
entityKind: string;
|
||||
entityId: string;
|
||||
kind: string;
|
||||
message: string;
|
||||
occurredAtUtc: string;
|
||||
family?: string;
|
||||
scopeKind?: string;
|
||||
scopeEntityId?: string | null;
|
||||
visibility?: string;
|
||||
}
|
||||
|
||||
export interface ObserverScope {
|
||||
scopeKind: string;
|
||||
systemId?: string | null;
|
||||
bubbleId?: string | null;
|
||||
}
|
||||
Reference in New Issue
Block a user