From f5df1c26dc3b647ca2ea7d70acbdaa861867d33b Mon Sep 17 00:00:00 2001 From: hyper Date: Thu, 23 Apr 2026 15:29:14 +0800 Subject: [PATCH] refactor: remove registry from Boop and Regicide index files --- src/samples/boop/index.ts | 60 ++++++++++------------ src/samples/regicide/index.ts | 94 +++++++++++++++++------------------ 2 files changed, 71 insertions(+), 83 deletions(-) diff --git a/src/samples/boop/index.ts b/src/samples/boop/index.ts index fca48ab..d82d6c3 100644 --- a/src/samples/boop/index.ts +++ b/src/samples/boop/index.ts @@ -1,49 +1,41 @@ // Types export type { - PlayerType, - PieceType, - WinnerType, - RegionType, - BoopPartMeta, - BoopPart -} from './types'; + PlayerType, + PieceType, + WinnerType, + RegionType, + BoopPartMeta, + BoopPart, +} from "./types"; -export type {BoopGame} from './types-extensions'; +export type { BoopGame } from "./types-extensions"; // Constants -export { - BOARD_SIZE, - MAX_PIECES_PER_PLAYER, - WIN_LENGTH -} from './constants'; +export { BOARD_SIZE, MAX_PIECES_PER_PLAYER, WIN_LENGTH } from "./constants"; // State -export { - createInitialState, - type BoopState -} from './state'; +export { createInitialState, type BoopState } from "./state"; // Prompts -export {prompts} from './prompts'; +export { prompts } from "./prompts"; // Commands export { - registry, - start, - place as placeCmd, - boop as boopCmd, - checkWin as checkWinCmd, - checkGraduates as checkGraduatesCmd, - checkFullBoard as checkFullBoardCmd, - turn as turnCmd -} from './commands'; + start, + place as placeCmd, + boop as boopCmd, + checkWin as checkWinCmd, + checkGraduates as checkGraduatesCmd, + checkFullBoard as checkFullBoardCmd, + turn as turnCmd, +} from "./commands"; // Utils export { - getLineCandidates, - isInBounds, - isCellOccupied, - getNeighborPositions, - findPartInRegion, - findPartAtPosition -} from './utils'; + getLineCandidates, + isInBounds, + isCellOccupied, + getNeighborPositions, + findPartInRegion, + findPartAtPosition, +} from "./utils"; diff --git a/src/samples/regicide/index.ts b/src/samples/regicide/index.ts index 83a123b..886b5ba 100644 --- a/src/samples/regicide/index.ts +++ b/src/samples/regicide/index.ts @@ -1,67 +1,63 @@ // Types export type { - SuitType, - CardRank, - PlayerType, - RegionType, - RegicideCardMeta, - RegicideCard, - Enemy, - GamePhase -} from './types'; + SuitType, + CardRank, + PlayerType, + RegionType, + RegicideCardMeta, + RegicideCard, + Enemy, + GamePhase, +} from "./types"; // Constants export { - ENEMY_COUNT, - INITIAL_HAND_SIZE, - CARD_VALUES, - ALL_SUITS, - ALL_RANKS, - FACE_CARDS, - NUMBER_CARDS -} from './constants'; + ENEMY_COUNT, + INITIAL_HAND_SIZE, + CARD_VALUES, + ALL_SUITS, + ALL_RANKS, + FACE_CARDS, + NUMBER_CARDS, +} from "./constants"; // State -export { - createInitialState, - type RegicideState -} from './state'; +export { createInitialState, type RegicideState } from "./state"; // Prompts -export {prompts} from './prompts'; +export { prompts } from "./prompts"; // Commands export { - registry, - play as playCmd, - playWithA as playWithACmd, - pass as passCmd, - enemyCounterattack as enemyCounterattackCmd, - checkEnemy as checkEnemyCmd, - checkCanPlay as checkCanPlayCmd, - checkTavernDeck as checkTavernDeckCmd, - nextTurn as nextTurnCmd, -} from './commands'; + play as playCmd, + playWithA as playWithACmd, + pass as passCmd, + enemyCounterattack as enemyCounterattackCmd, + checkEnemy as checkEnemyCmd, + checkCanPlay as checkCanPlayCmd, + checkTavernDeck as checkTavernDeckCmd, + nextTurn as nextTurnCmd, +} from "./commands"; // Game export { - setupGame, - start, - playTurn, - handleCounterattack, - getGameStatus, - type RegicideGame -} from './game'; + setupGame, + start, + playTurn, + handleCounterattack, + getGameStatus, + type RegicideGame, +} from "./game"; // Utils export { - getCardValue, - createCard, - createEnemy, - createAllCards, - buildEnemyDeck, - buildTavernDeck, - drawFromDeck, - isEnemyDefeated, - getPlayerHandRegionId -} from './utils'; + getCardValue, + createCard, + createEnemy, + createAllCards, + buildEnemyDeck, + buildTavernDeck, + drawFromDeck, + isEnemyDefeated, + getPlayerHandRegionId, +} from "./utils";