feat(runner): wire spell registry in CLI and Monte Carlo

This commit is contained in:
ctan
2026-08-31 13:22:16 +02:00
parent 3f65e769cf
commit a88187db20
4 changed files with 89 additions and 3 deletions
+3 -1
View File
@@ -19,6 +19,7 @@ if TYPE_CHECKING:
from pf1e_simulator.loaders import CombatantLoadError, SheetLoadError, load_combatant
from pf1e_simulator.map import MapValidationError, load_map
from pf1e_simulator.runner import EncounterSpec, Side, run_encounter
from pf1e_simulator.spells import SPELLS_DIR, load_spell_registry
class CliError(Exception):
@@ -111,7 +112,8 @@ def main(argv: list[str] | None = None) -> int:
print(f"pf1e-sim: {exc}", file=sys.stderr)
return 2
try:
report = run_encounter(spec, runs=args.runs, seed=args.seed)
registry = load_spell_registry(SPELLS_DIR)
report = run_encounter(spec, runs=args.runs, seed=args.seed, spell_registry=registry)
except ValueError as exc:
print(f"pf1e-sim: {exc}", file=sys.stderr)
return 2