**Architectural Improvement**: Unified player references in GameState **Changed**: Make all player references consistent - BEFORE: current_batter/pitcher/catcher were IDs (int) - AFTER: current_batter/pitcher/catcher are full LineupPlayerState objects - Matches pattern of on_first/on_second/on_third (already objects) **Benefits**: 1. Consistent API - all player references use same type 2. Self-contained GameState - everything needed for resolution 3. No lookups needed - direct access to player data 4. Sets foundation for Phase 3E-Main (adding position ratings) **Files Modified**: - app/models/game_models.py: Changed current_batter/pitcher/catcher to objects - app/core/game_engine.py: Updated _prepare_next_play() to populate full objects - app/core/state_manager.py: Create placeholder batter on game creation - tests/unit/models/test_game_models.py: Updated all 27 GameState tests **Database Operations**: - No schema changes needed - Play table still stores IDs (for referential integrity) - IDs extracted from objects when saving: state.current_batter.lineup_id **Testing**: - All 27 GameState tests passing - No regressions in existing functionality - Type checking passes **Next**: Phase 3E-Main - Add PositionRating dataclass and load ratings at game start 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| CLAUDE.md | ||
| db_models.py | ||
| game_models.py | ||
| player_model_info.md | ||
| player_models.py | ||
| roster_models.py | ||
| visual_model_relationships.md | ||