Extract cast context policy

This commit is contained in:
2026-06-27 03:43:07 +02:00
parent 972c8f14b6
commit 9884b6f6e7
6 changed files with 143 additions and 81 deletions
+3 -8
View File
@@ -3,9 +3,11 @@ from __future__ import annotations
from typing import Any, Callable
try:
from . import cast_context as cast_context_policy
from . import pair_clothing
from . import pair_options
except ImportError: # Allows local smoke tests with top-level imports.
import cast_context as cast_context_policy
import pair_clothing
import pair_options
@@ -18,14 +20,7 @@ SlotSoftcoreOutfit = Callable[[dict[str, Any] | None, Any], str]
def cast_summary_phrase(women_count: int, men_count: int) -> str:
women_count = max(0, int(women_count))
men_count = max(0, int(men_count))
if women_count + men_count == 0:
women_count = 1
person_count = women_count + men_count
women_label = "woman" if women_count == 1 else "women"
men_label = "man" if men_count == 1 else "men"
return f"{women_count} {women_label}, {men_count} {men_label}, {person_count} total adults"
return cast_context_policy.cast_summary_phrase(women_count, men_count)
def softcore_partner_styling(