import type { Contract, SaveDocument } from "../src/index"; const T = Date.parse("2100-01-01T00:00:00Z"); /** A contract as the sim builds it. */ export const sampleContract: Contract = { id: "earth:1:0", originId: "earth", destinationId: "moon", cargoTypeId: "standard", goodId: "consumer-goods", shipper: "Pacific Orbital Logistics", priority: false, deliveryWindowGameHours: null, tier: 0, massTonnes: 12, payout: 1500, requiredSkill: null, requiredLongHaulLevel: 0, offeredAt: T, expiresAt: T + 600_000, firstContact: false, }; /** * A save with every collection and every optional field filled: a mid-game * company after the deal, with an upgraded ship in the shop, a resting pilot, * one flight under way and one resolved and unseen. */ export function fullSave(): SaveDocument { const record = (id: string, arrivalAt: number) => ({ id, shipId: "s1", pilotId: "avatar", contract: sampleContract, originId: "earth", destinationId: "moon", tutorial: false, departureAt: T, arrivalAt, distanceMillionKm: 0.38, fuelCost: 160, expectedPayout: 1500, seed: 42, }); return { saveVersion: 1, saveId: "save-1", lastTimeSeen: T + 3_600_000, player: { worldSeed: 0xdeadbeef, tutorialActive: false, loanerLocationId: null, tutorialRunsCompleted: 4, dealAccepted: true, createdAt: T, }, company: { id: "co1", name: "Deadhead Freight", credits: 12_345, loanBalance: 60_000 }, ships: [ { id: "s1", modelId: "courier", name: "Dusty Mule", status: "in-flight", locationId: null, upgrades: { engines: 2, "fuel-tanks": 1 }, inShopUntil: null, shopUpgradeId: null, shopLevel: null, fromDeal: true, createdAt: T, lastArrivalAt: T + 200_000, }, { id: "s2", modelId: "clipper", name: "Swift Heron", status: "idle", locationId: "earth", upgrades: {}, inShopUntil: T + 7_200_000, shopUpgradeId: "cargo-bay", shopLevel: 1, fromDeal: true, createdAt: T, lastArrivalAt: T, }, ], pilots: [ { id: "avatar", name: "Captain", isAvatar: true, isVeteran: false, xp: 120, skills: { "long-haul": 1 }, skillPointsSpent: 1, assignedShipId: "s1", locationId: null, status: "in-flight", dutyHours: 4.5, restEndsAt: null, createdAt: T, }, { id: "veteran", name: "Rosa Kell", isAvatar: false, isVeteran: true, xp: 250, skills: { "expensive-cargo": 1 }, skillPointsSpent: 1, assignedShipId: "s2", locationId: null, status: "idle", dutyHours: 0, restEndsAt: T + 3_000_000, createdAt: T, }, ], bays: [{ id: "b1", locationId: "earth", createdAt: T }], discoveredLocations: [ { locationId: "earth", discoveredAt: T }, { locationId: "moon", discoveredAt: T }, ], contractBoards: [ { id: "board-1", kind: "location", locationId: "earth", periodIndex: 1, tutorialRun: 0, contracts: [sampleContract], createdAt: T, }, ], dispatches: [ { id: "d1", shipId: "s1", pilotId: "avatar", tutorial: false, record: record("d1", T + 9_000_000), arrivalAt: T + 9_000_000, status: "in-flight", resolution: null, resolvedAt: null, acknowledgedAt: null, }, { id: "d0", shipId: "s1", pilotId: "avatar", tutorial: false, record: record("d0", T + 200_000), arrivalAt: T + 200_000, status: "resolved", resolution: { credits: 1000, pilotPay: 0, loanRepayment: 340, pilotXp: 10, shipLocationId: "moon", discoversDestination: false, pilotDutyHours: 2.4, pilotRestEndsAt: null, }, resolvedAt: T + 200_000, acknowledgedAt: null, }, ], acceptedContracts: [ { contractId: sampleContract.id, periodIndex: 1, dispatchId: "d1", acceptedAt: T }, ], claimedGoals: [{ goalId: "first-own-delivery", claimedAt: T + 300_000 }], stats: { contractDeliveries: 1, priorityDeliveries: 0 }, }; }