"""
FreeExile Map Style Domain Models and Types.
Strictly typed immutable dataclasses for 30 Dark Fantasy Cổ Võ Hoang Vực biomes,
tile texture bindings, lighting, atmospheric fog, and decorative props.
"""

from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple


@dataclass(slots=True, frozen=True)
class MapStylePalette:
    """Core 5-color palette defining the aesthetic identity of a biome."""
    floor: str
    wall: str
    path: str
    liquid: str
    ambient: str


@dataclass(slots=True, frozen=True)
class MapStyleLighting:
    """Atmospheric lighting and volumetric fog configuration."""
    ambient_hex: str
    intensity: float = 1.0
    fog_density: float = 0.30


@dataclass(slots=True, frozen=True)
class MapStyleHazard:
    """Environmental hazard attributes governing movement penalty and DOT damage."""
    slow_factor: float = 1.0
    dps: int = 0


@dataclass(slots=True, frozen=True)
class MapStyleTileMapping:
    """Relational binding connecting a TileType code to its texture and normal assets."""
    style_id: str
    tile_code: int
    texture_path: str
    normal_path: str
    procedural_fallback_color: str
    tile_type_name: str = ""
    texture_width: int = 128
    texture_height: int = 64
    is_seamless: int = 1
    elevation_px: int = 0
    roughness: float = 0.8


@dataclass(slots=True, frozen=True)
class MapStylePropDefinition:
    """Relational decorative prop entity with placement constraints and spawn weight."""
    style_id: str
    prop_id: str
    name_vi: str
    placement_rule: str
    spawn_weight: float
    footprint_w: int = 1
    footprint_h: int = 1
    name_en: str = ""
    sprite_key: str = ""
    sprite_path: str = ""
    blocks_movement: int = 0
    elevation_z: int = 0


@dataclass(slots=True, frozen=True)
class MapStyleDefinition:
    """Master definition of a Dark Fantasy Cổ Võ Hoang Vực map style."""
    style_id: str
    biome_code: int
    name_vi: str
    name_en: str
    theme_category: str
    palette: MapStylePalette
    lighting: MapStyleLighting
    hazard: MapStyleHazard
    legacy_alias: Optional[str] = None
    theme_category_name: str = ""
    description: str = ""
    movement_modifier: float = 1.0
    asset_dir: str = ""
    monster_family: str = ""
    terrain_types: Tuple[Tuple[str, str], ...] = ()
