feat(game): tasks table + schema v7 backfill, admin registry (#44)

This commit is contained in:
2026-10-02 13:08:53 +00:00
parent f52a59c5fc
commit 6c51c3cec8
6 changed files with 78 additions and 1 deletions
+18
View File
@@ -6,6 +6,24 @@ import type { CrewMember } from './crew'
export type TaskType = 'JUMP' | 'EXPLORE' | 'SHIP_UPGRADE' | 'SHIP_EXPAND' | 'SHIP_BUILD' | 'RESEARCH'
export type TaskStatus = 'ACTIVE' | 'PENDING' | 'DONE'
// One queued/active/done action (spec §3). `payload` is a JSON string whose shape depends on
// the TaskType: JUMP {systemId, hops} · SHIP_UPGRADE/EXPAND {systemId} · SHIP_BUILD {type} ·
// RESEARCH {techId} · EXPLORE {planetId}.
export interface Task {
id: number
saveId: number
type: TaskType
payload: string
leadCrewId: number
helpers: number[]
duration: number
remaining: number
status: TaskStatus
queuedAtTurn: number
}
// Work points per action (spec §4): JUMP scales with hop count, the rest are flat.
function workPoints(type: TaskType, hopCount: number): number {
switch (type) {