Repository navigation
Conversation
CheckpointId parses "SS.CC" ids like "03.08" (exactly two digits, a dot, two digits), prints them back, orders them, and starts_segment() tells a caller when a run enters a new segment so it can count Segments Started.
FRLG splits boss battles out of a checkpoint without renumbering the ones after it (00.12b, 12.02b). The suffix sorts after the bare id and before the next checkpoint; starts_segment ignores it.
suffix is std::optional<char> instead of a '\0' sentinel, the fields have defaults and are private behind accessors, so parse() is the only way to build an id. Order tests take ids as text. The parse test expects one optional. Sorted the CMake list and the test-runner include; shortened the starts_segment comment.
…ostory/checkpoint-id
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 82eccbd
Verdict
NEEDS_REWORK
First-pass review (agent), own diff against autostory/checkpoint-id. Code health: 0 failures (4 advisories). CI at review time: build/code-health/no-tabs pass; Fork Draft CI ubuntu / build still pending, so the StoryActionArg suite has not run yet.
Medium
Types/Pokemon_StoryActionArg_Tests.cpp(header comment, the#ifndef/#ifdef PA_STORY_DATA_STANDALONEblocks andmain()): nothing definesPA_STORY_DATA_STANDALONE, not in this PR, not in CMake/CI, not at 00c6ceb. The standalonemain()is dead code and the comment promises a build that does not exist. Drop the macro, the guards andmain(), or add the target that builds it.Types/Pokemon_DeclaredPose.h: nothing in this PR includes it, andTileDeclaredis field for fieldGridPose(map, tiles, facing). Either move the header to the PR that reads declared poses, or say why the tile kind is not justGridPose(using TileDeclared = GridPose;orstd::variant<GridPose, ZoneDeclared>).Pokemon/Navigation/Pokemon_Grid.{h,cpp},Pokemon_Direction.{h,cpp}:Grid<Cell>,cell_at,TilePos::next,to_string(TilePos), thestd::hashspecialization,ALL_DIRECTIONS,direction_name(andstory_step_kind_name) have no caller and no test in this PR. This is shared navigation code at the bottom of the chain; it should land with its tests (at leastnextper direction,containson the edges, hash/<=>on negative coordinates), or with the PR that first uses it.
Low
- Comments point at things that do not exist yet at this PR:
Pokemon_StoryActionArg.h->Data/Pokemon_StoryStepJson.h;Pokemon_StoryStepKind.h->Pokemon_StoryStepExecutor.h;Pokemon_StoryActionSpec.h->StoryBackendKindand the "console_only" failure (theconsole_onlyfield itself is unused here);Pokemon_DeclaredPose.h->StoryPoseTraits::Declaredand "the lint". Fine once the chain lands, but a reviewer of this PR alone cannot follow them; either add a "(later in the chain)" note in the PR description or move the field/comment with its user. Types/Pokemon_StoryActionSpec.hStoryArgSpec:required = trueplus afallbackis representable and meaningless (the fallback is never used for a required arg). Three valid states (required / optional with fallback / optional without) - consider a small enum or document that the pair is invalid, and havestory_args_errorsor the table reject it.Types/Pokemon_StoryActionArg_Tests.cppcheck_case():""means pass - a sentinel.std::optional<std::string>(failure text or nothing) says it in the type.Pokemon_MapUtil.h:value_at_ithas no caller. Every call ofvalue_if_at_itnames the map twice (value_if_at_it<int64_t>(args, args.find("floor"))); avalue_if<Type>(map, key)reads simpler. It is also not Pokemon- or AutoStory-specific, soPokemon/AutoStoryis an odd home if it is meant to be reused.Types/Pokemon_StoryActionArg.cppstory_arg_type(): C-style cast ofindex(); avalueless_by_exceptionvariant gives an out-of-range enum. Nit-level, but astatic_castplus that note costs nothing.- Comment style:
// Action category classification for individual story steps.,// Returns the readable string representation...,// Array containing all four cardinal directions.,// Hash specialization for TilePos.,// Grid coordinate with integer x and y components.restate the code and use//where the rest of the PR uses//. Replace with a why or drop. Pokemon_BuiltinStoryActions.h: the comment table abovebuiltin_story_actions()repeatsmake_builtin_actions()line by line and will drift; point at the .cpp instead, or keep only the "first one is the default" rule.
No brace-style, tabs, CRLF, Qt, std::filesystem or threading issues. SourceFiles.cmake lists every new file.
…e step types Nothing defines PA_STORY_DATA_STANDALONE, so the standalone main() and its guards were dead. Pokemon_DeclaredPose.h has no reader here; it moves to the PR that adds the step and checkpoint types that hold one.
|
Review fixes, tip Fixed: 1 (standalone main() and guards dropped), 2 (Pokemon_DeclaredPose.h moved to #531, where the step types first hold one), 6 (check_case returns std::optional), 8 (static_cast with the valueless note). |
Depends on #519
Adds the bottom of the shared AutoStory vocabulary: the tile grid and directions (Pokemon/Navigation), step kinds, typed action args and specs, grid poses, and the table of built-in story actions with the args each takes. A step's args are checked against its action's spec when read, so a typo in story data fails at load, not on the console. It also adds add_tests_AutoStory(), the one entry the unit test runner calls for the shared AutoStory suites. Tests: the StoryActionArg suite (synthetic, no CommandLineTests frames), built and run by Fork Draft CI. Part of the re-split of #522/#524/#525 into reviewable steps; review fixes are new commits on the PR that owns each problem, merged up the chain.