diff --git a/src/index.ts b/src/index.ts index ba43daa..862efef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,34 +4,71 @@ */ // Core types -export type { IGameContext } from './core/game'; -export { createGameCommandRegistry, createPromptDef } from './core/game'; +export type { IGameContext } from "./core/game"; +export { createGameCommandRegistry, createPromptDef } from "./core/game"; -export type { GameHost, GameHostStatus, GameModule } from './core/game-host'; -export { createGameHost } from './core/game-host'; +export type { GameHost, GameHostStatus, GameModule } from "./core/game-host"; +export { createGameHost } from "./core/game-host"; -export type { Part } from './core/part'; -export { flip, flipTo, roll } from './core/part'; +export type { Part } from "./core/part"; +export { flip, flipTo, roll } from "./core/part"; -export { createParts, createPartsFromTable } from './core/part-factory'; +export { createParts, createPartsFromTable } from "./core/part-factory"; -export type { Region, RegionAxis } from './core/region'; -export { createRegion, createRegionAxis, applyAlign, shuffle, moveToRegion } from './core/region'; +export type { Region, RegionAxis } from "./core/region"; +export { + createRegion, + createRegionAxis, + applyAlign, + shuffle, + moveToRegion, +} from "./core/region"; // Utils -export type { Command, CommandDef, CommandResult, CommandSchema, CommandParamSchema, CommandOptionSchema, CommandFlagSchema } from './utils/command'; -export { parseCommand, parseCommandSchema, validateCommand, parseCommandWithSchema, applyCommandSchema } from './utils/command'; +export type { + Command, + CommandDef, + CommandResult, + CommandSchema, + CommandParamSchema, + CommandOptionSchema, + CommandFlagSchema, +} from "./utils/command"; +export { + parseCommand, + parseCommandSchema, + validateCommand, + parseCommandWithSchema, + applyCommandSchema, +} from "./utils/command"; -export type { CommandRunner, CommandRunnerHandler, CommandRunnerContext, PromptEvent, CommandRunnerEvents } from './utils/command'; -export { createCommandRegistry, registerCommand, unregisterCommand, hasCommand, getCommand, runCommand, runCommandParsed, createCommandRunnerContext, type CommandRegistry, type CommandRunnerContextExport } from './utils/command'; +export type { + CommandRunner, + CommandRunnerHandler, + CommandRunnerContext, + PromptEvent, + CommandRunnerEvents, +} from "./utils/command"; +export { + createCommandRegistry, + registerCommand, + unregisterCommand, + hasCommand, + getCommand, + runCommand, + runCommandParsed, + createCommandRunnerContext, + type CommandRegistry, + type CommandRunnerContextExport, +} from "./utils/command"; -export type { MutableSignal } from './utils/mutable-signal'; -export { mutableSignal } from './utils/mutable-signal'; +export type { MutableSignal } from "./utils/mutable-signal"; +export { mutableSignal } from "./utils/mutable-signal"; -export type { RNG } from './utils/rng'; -export { createRNG, Mulberry32RNG } from './utils/rng'; +export type { RNG, ReadonlyRNG } from "./utils/rng"; +export { createRNG, Mulberry32RNG } from "./utils/rng"; -export type {MiddlewareChain} from './utils/middleware' -export { createMiddlewareChain } from './utils/middleware'; +export type { MiddlewareChain } from "./utils/middleware"; +export { createMiddlewareChain } from "./utils/middleware"; -export * from '@preact/signals-core'; \ No newline at end of file +export * from "@preact/signals-core"; diff --git a/src/samples/slay-the-spire-like/data/desert/index.ts b/src/samples/slay-the-spire-like/data/desert/index.ts index e797a04..a00f499 100644 --- a/src/samples/slay-the-spire-like/data/desert/index.ts +++ b/src/samples/slay-the-spire-like/data/desert/index.ts @@ -1,15 +1,19 @@ -import getCards from './card.csv'; -import getEffects from './effect.csv'; -import getEncounters from './encounter.csv'; -import getEnemies from './enemy.csv'; -import getIntents from './intent.csv'; -import getItems from './item.csv'; -export { default as dialogues } from './dialogues/dialogues.yarnproject'; -export { addTriggers } from './triggers'; +import getCards from "./card.csv"; +import getEffects from "./effect.csv"; +import getEncounters from "./encounter.csv"; +import getEnemies from "./enemy.csv"; +import getIntents from "./intent.csv"; +import getItems from "./item.csv"; +export { default as dialogues } from "./dialogues/dialogues.yarnproject"; +export { addTriggers } from "./triggers"; export const cards = getCards(); export const effects = getEffects(); export const encounters = getEncounters(); export const enemies = getEnemies(); export const intents = getIntents(); -export const items = getItems(); \ No newline at end of file +export const items = getItems(); + +export const startingItems = ["剑", "盾", "水袋", "绷带"].map((key) => + items.find((item) => item.name === key), +);