Extract cast context policy
This commit is contained in:
+3
-8
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user