"""
League configuration system for game rules and settings.

Provides:
  - League configurations (BaseGameConfig, SbaConfig, PdConfig)
  - Play outcome definitions (PlayOutcome enum)
  - Application settings (Settings, get_settings) - imported from config.py for backward compatibility

Usage:
    from app.config import get_league_config, PlayOutcome, get_settings

    # Get config for specific league
    config = get_league_config("sba")
    api_url = config.get_api_base_url()

    # Use play outcomes
    if outcome == PlayOutcome.SINGLE_UNCAPPED:
        # Handle uncapped hit decision tree

    # Get application settings
    settings = get_settings()
"""

# Import Settings and get_settings from sibling config.py for backward compatibility
# This imports from /app/config.py (not /app/config/__init__.py)
import sys
from pathlib import Path

from app.config.base_config import BaseGameConfig
from app.config.league_configs import (
    LEAGUE_CONFIGS,
    PdConfig,
    SbaConfig,
    get_league_config,
)
from app.config.result_charts import PlayOutcome

# Temporarily modify path to import the config.py file
config_py_path = Path(__file__).parent.parent / "config.py"
spec = __import__("importlib.util").util.spec_from_file_location(
    "_app_config", config_py_path
)
_app_config = __import__("importlib.util").util.module_from_spec(spec)
spec.loader.exec_module(_app_config)

Settings = _app_config.Settings
get_settings = _app_config.get_settings

__all__ = [
    "BaseGameConfig",
    "SbaConfig",
    "PdConfig",
    "LEAGUE_CONFIGS",
    "get_league_config",
    "PlayOutcome",
    "Settings",
    "get_settings",
]
