paper-dynasty-discord/in_game/managerai_responses.py
Cal Corum ee80cd72ae fix: apply Black formatting and resolve ruff lint violations
Run Black formatter across 83 files and fix 1514 ruff violations:
- E722: bare except → typed exceptions (17 fixes)
- E711/E712/E721: comparison style fixes with noqa for SQLAlchemy (44 fixes)
- F841: unused variable assignments (70 fixes)
- F541/F401: f-string and import cleanup (1383 auto-fixes)

Remaining 925 errors are all F403/F405 (star imports) — structural,
requires converting to explicit imports in a separate effort.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:37:46 -05:00

51 lines
1.2 KiB
Python

import pydantic
class AiResponse(pydantic.BaseModel):
ai_note: str = ""
class RunResponse(AiResponse):
min_safe: int | None = None
class JumpResponse(RunResponse):
must_auto_jump: bool = False
run_if_auto_jump: bool = False
class TagResponse(RunResponse):
pass
class UncappedRunResponse(RunResponse):
send_trail: bool = False
trail_min_safe: int = 10
trail_min_safe_delta: int = 0
class ThrowResponse(AiResponse):
cutoff: bool = False # Stops on True
at_lead_runner: bool = True
at_trail_runner: bool = False # Stops on False
trail_max_safe: int = 10
trail_max_safe_delta: int = -6
class DefenseResponse(AiResponse):
hold_first: bool = False
hold_second: bool = False
hold_third: bool = False
outfield_in: bool = False
infield_in: bool = False
corners_in: bool = False
def defender_in(self, position: str):
if self.infield_in and (position in ["C", "1B", "2B", "3B", "SS", "P"]):
return True
elif self.corners_in and (position in ["C", "1B", "3B", "P"]):
return True
elif self.outfield_in and (position in ["LF", "CF", "RF"]):
return True
return False