from typing import Protocol, runtime_checkable

from .state import MatchState, SimulationResult


@runtime_checkable
class SimulationEngine(Protocol):
    """Contract implemented by a concrete pure-Python match engine.

    Implementations must be deterministic for the same immutable MatchState
    and seed.  The protocol intentionally says nothing about Django, HTTP or
    persistence.
    """

    key: str
    version: str

    def simulate(self, state: MatchState, *, seed: int) -> SimulationResult:
        ...
