feat(game): tasks table + schema v7 backfill, admin registry (#44)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user