Refactor simulation and viewer architecture
This commit is contained in:
52
apps/viewer/src/contractsShips.ts
Normal file
52
apps/viewer/src/contractsShips.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import type { InventoryEntry, Vector3Dto } from "./contractsCommon";
|
||||
|
||||
export interface ShipSnapshot {
|
||||
id: string;
|
||||
label: string;
|
||||
role: string;
|
||||
shipClass: string;
|
||||
systemId: string;
|
||||
localPosition: Vector3Dto;
|
||||
localVelocity: Vector3Dto;
|
||||
targetLocalPosition: Vector3Dto;
|
||||
state: string;
|
||||
orderKind: string | null;
|
||||
defaultBehaviorKind: string;
|
||||
controllerTaskKind: string;
|
||||
nodeId?: string | null;
|
||||
bubbleId?: string | null;
|
||||
dockedStationId?: string | null;
|
||||
commanderId?: string | null;
|
||||
policySetId?: string | null;
|
||||
cargoCapacity: number;
|
||||
workerPopulation: number;
|
||||
energyStored: number;
|
||||
inventory: InventoryEntry[];
|
||||
factionId: string;
|
||||
health: number;
|
||||
history: string[];
|
||||
spatialState: ShipSpatialStateSnapshot;
|
||||
}
|
||||
|
||||
export interface ShipDelta extends ShipSnapshot {}
|
||||
|
||||
export interface ShipSpatialStateSnapshot {
|
||||
spaceLayer: string;
|
||||
currentSystemId: string;
|
||||
currentNodeId?: string | null;
|
||||
currentBubbleId?: string | null;
|
||||
localPosition?: Vector3Dto | null;
|
||||
systemPosition?: Vector3Dto | null;
|
||||
movementRegime: string;
|
||||
destinationNodeId?: string | null;
|
||||
transit?: ShipTransitSnapshot | null;
|
||||
}
|
||||
|
||||
export interface ShipTransitSnapshot {
|
||||
regime: string;
|
||||
originNodeId?: string | null;
|
||||
destinationNodeId?: string | null;
|
||||
startedAtUtc?: string | null;
|
||||
arrivalDueAtUtc?: string | null;
|
||||
progress: number;
|
||||
}
|
||||
Reference in New Issue
Block a user