4c5e2ed945
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import type { GameStep, MainGameState, SiteStep } from "@/types/game";
|
|
|
|
/**
|
|
* Steps for the /site onboarding page
|
|
*/
|
|
export const SITE_STEPS: readonly SiteStep[] = [
|
|
"welcome",
|
|
"situation",
|
|
"naming",
|
|
"transition",
|
|
];
|
|
|
|
/**
|
|
* Steps for the intro sequence (after /site, on / route)
|
|
*/
|
|
export const GAME_STEPS: readonly GameStep[] = [
|
|
"loading-map",
|
|
"video",
|
|
"dialogue-intro",
|
|
"reveal",
|
|
"playing",
|
|
];
|
|
|
|
export const MAIN_GAME_STATES: readonly MainGameState[] = [
|
|
"intro",
|
|
"ebike",
|
|
"pylon",
|
|
"farm",
|
|
"outro",
|
|
] as const;
|
|
|
|
const SITE_STEP_VALUES: ReadonlySet<string> = new Set(SITE_STEPS);
|
|
const GAME_STEP_VALUES: ReadonlySet<string> = new Set(GAME_STEPS);
|
|
const MAIN_GAME_STATE_VALUES: ReadonlySet<string> = new Set(MAIN_GAME_STATES);
|
|
|
|
export function isSiteStep(value: unknown): value is SiteStep {
|
|
return typeof value === "string" && SITE_STEP_VALUES.has(value);
|
|
}
|
|
|
|
export function isGameStep(value: unknown): value is GameStep {
|
|
return typeof value === "string" && GAME_STEP_VALUES.has(value);
|
|
}
|
|
|
|
export function isMainGameState(value: unknown): value is MainGameState {
|
|
return typeof value === "string" && MAIN_GAME_STATE_VALUES.has(value);
|
|
}
|