/**
 * Mini-game types and registry for couch/online mini-game collections.
 */
const MINI_PLAYER_COLORS = [
    "#e74c3c", "#3498db", "#2ecc71", "#f1c40f",
    "#9b59b6", "#e67e22", "#1abc9c", "#e91e63",
];
const MINI_PLAYER_NAMES = [
    "Player 1", "Player 2", "Player 3", "Player 4",
    "Player 5", "Player 6", "Player 7", "Player 8",
];
const DIR_UP = { dx: 0, dy: -1 };
const DIR_DOWN = { dx: 0, dy: 1 };
const DIR_LEFT = { dx: -1, dy: 0 };
const DIR_RIGHT = { dx: 1, dy: 0 };
const KEYBOARD_GROUPS = [
    { up: "w", down: "s", left: "a", right: "d", action: " " },
    { up: "ArrowUp", down: "ArrowDown", left: "ArrowLeft", right: "ArrowRight", action: "Enter" },
    { up: "i", down: "k", left: "j", right: "l", action: "u" },
    { up: "8", down: "5", left: "4", right: "6", action: "0" }, // numpad mapped
];
/**
 * GameRegistry — typed registry of available mini-games.
 *
 * Call `registry.register(meta)` to add games.
 * Call `registry.all()` or `registry.find(id)` to query.
 */
class GameRegistry {
    constructor() {
        this.games = new Map();
    }
    register(meta) {
        this.games.set(meta.id, meta);
    }
    registerAll(metas) {
        for (const m of metas)
            this.register(m);
    }
    unregister(id) {
        this.games.delete(id);
    }
    find(id) {
        return this.games.get(id);
    }
    all() {
        return Array.from(this.games.values());
    }
    filter(predicate) {
        return this.all().filter(predicate);
    }
    /** Games that support the given player count. */
    forPlayerCount(n) {
        return this.filter(m => n >= m.minPlayers && n <= m.maxPlayers);
    }
}
/** Default singleton registry */
const gameRegistry = new GameRegistry();

export { DIR_DOWN, DIR_LEFT, DIR_RIGHT, DIR_UP, GameRegistry, KEYBOARD_GROUPS, MINI_PLAYER_COLORS, MINI_PLAYER_NAMES, gameRegistry };
//# sourceMappingURL=MiniGameTypes.js.map
