'use client';

import { useContext } from 'react';
import { GameContext } from './context-create';
import type { GameContextValue } from './types';

export function useGameContext(): GameContextValue {
  const context = useContext(GameContext);
  if (!context) {
    throw new Error('useGameContext must be used within a GameProvider');
  }
  return context;
}
