Files
space-game/apps/viewer/src/contractsShips.ts

61 lines
1.5 KiB
TypeScript

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;
cargoItemId?: string | null;
workerPopulation: number;
travelSpeed: number;
travelSpeedUnit: string;
inventory: InventoryEntry[];
factionId: string;
health: number;
history: string[];
currentAction?: ShipActionProgressSnapshot | null;
spatialState: ShipSpatialStateSnapshot;
}
export interface ShipDelta extends ShipSnapshot { }
export interface ShipActionProgressSnapshot {
label: string;
progress: number;
}
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;
}