"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGameList = getGameList;
exports.findGame = findGame;
exports.createGame = createGame;
exports.getDefaultGameId = getDefaultGameId;
const snake_1 = require("./games/snake");
const game_2048_1 = require("./games/game-2048");
const tetris_1 = require("./games/tetris");
const tic_tac_toe_1 = require("./games/tic-tac-toe");
const breakout_1 = require("./games/breakout");
const minesweeper_1 = require("./games/minesweeper");
const flappy_bird_1 = require("./games/flappy-bird");
const registry = [
    { id: 'snake', name: 'Snake', create: () => new snake_1.SnakeGame() },
    { id: '2048', name: '2048', create: () => new game_2048_1.Game2048() },
    { id: 'tetris', name: 'Tetris', create: () => new tetris_1.TetrisGame() },
    { id: 'tictactoe', name: 'Tic-Tac-Toe', create: () => new tic_tac_toe_1.TicTacToeGame(), supportsExternalMoves: true },
    { id: 'breakout', name: 'Breakout', create: () => new breakout_1.BreakoutGame() },
    { id: 'minesweeper', name: 'Minesweeper', create: () => new minesweeper_1.MinesweeperGame() },
    { id: 'flappy', name: 'Flappy Bird', create: () => new flappy_bird_1.FlappyBirdGame() },
];
function getGameList() {
    return registry;
}
function findGame(idOrName) {
    const lower = idOrName.toLowerCase();
    return registry.find(g => g.id === lower || g.name.toLowerCase() === lower);
}
function createGame(id) {
    const info = findGame(id);
    if (!info)
        throw new Error(`Unknown game: ${id}`);
    return info.create();
}
function getDefaultGameId() {
    return 'snake';
}
//# sourceMappingURL=game-registry.js.map