Repository navigation
Pokemon Navigation: shared fault classes and fault counters for the sims - #422
Conversation
… for the sims Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…inks Pokemon_Direction.cpp) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
|
API review (claude-sonnet-5-5) at 6d55195: LGTM_with_nits No bugs or hard-rule violations. The counters behave as described and the tests cover them. Two small style points: the fault-class list is not checked against the enum, and one readability nit in the test helper. The C-style cast and the missing include are minor.
|
…or, static_cast, <utility> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: c55e280
LGTM_with_nits
Verdict
APPROVED
No bugs. Counters, enum/list consistency test, CMake and runner registration, and control-flow formatting are fine. Defensive-reader bar: nothing parses input here; SimFaults::chances()/faulted() use find and return 0 for an unknown class, next() on an unnamed class counts and faults none, and an empty or non-positive std::set never faults, so no crash path.
Prior review (801c8bf) findings:
- [nit, NOT fixed]
fault_class_name()still returns the bare literal "?" for an unknown value,test_class_names()andtest_classes_match_enum()still compare against that literal as an end-of-enum marker, and the header does not document the fallback. Fix:constexpr std::string_view UNKNOWN_FAULT_CLASS_NAME = "?";declared in the header, used in the .cpp and both tests, with one header line saying what an unknown value returns.
New nits:
- [nit] The test comment says a class with no name "fails to build". That holds only because warnings are errors (-Wswitch is a warning,
/W4 /WXand strict CI flags); say "fails the warnings-as-errors build". - [nit] The description's "11 passed" was not re-run in this review (no build was made); it is the author's claim, and the test file adds 6 cases, the rest being the golden suites.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Depends on #419. Base
nav/sim-goldens; the diff shows only this change.BDSP's and FRLG's fault sweeps each keep their own
FaultClassenum, and FRLG's sim picks the nth turn tap, step tap or warp to fault with its own counters andstd::set<int>s. This adds the shared piece for seam 3's S3-1 inPokemon/Navigation/Simulation/Pokemon_SimFaults.{h,cpp}: oneFaultClasscovering both games' classes (scene end pose, scene early, battle opening, wild battles, late fade, slow fade-in, warp no-op, dark cave, lost tap, unseen step),FaultOccurrences(which chances of a fault to fault, numbered from 1 as FRLG'sSimScriptsets are), andSimFaults, a counter per class. Nothing uses it yet; the per-game switch-overs follow, with the goldens from #420 and #421 unchanged.Tested with the headless runner:
Pokemon::Navigation - Sim(sim faults and sim golden suites), 11 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss