Appearance
Lesson 08 — Commit a claim and rebuild
Where this lesson fits: lesson 07 produces a proposed result. This lesson follows the transaction that turns it into the new playable world.
Time: 2–3 hours
Prerequisites and outcomes
Complete lesson 07 and the wall-path lesson. By the end, you can trace the no-result recovery and successful commit paths without mixing their effects.
Prepare and run
- Reuse the tutorial chapter 06 project prepared in lesson 07; do not copy it again.
- In its staged
Source\Game\LastPerimeterApp.cs, search forProcessCompletedTrailandApplyClaimResult. Follow tutorial chapter 06 steps 3–6. The staged app performs the handoff inline; the final app usesCompleteTrailClaim. - From your learner project's solution folder, run
dotnet test --filter "FullyQualifiedName~AreaClaimingSystemTests|FullyQualifiedName~LearningPlan3CaptureTests|FullyQualifiedName~WallSystemV2Tests". At least those three classes must be discovered. - Run
dotnet run --project Platforms\DesktopVKand perform the corner-cut and hairpin in the tutorial's checkpoint. - Stage note: score, capture audio, and enemy removal are taught later. Compare the full operation sequence with
last-perimeter\Source\Game\LastPerimeterApp.csin the course repository without copying it into your staged project.
Code anchors
LastPerimeterApp.CompleteTrailClaiminlast-perimeter/Source/Game/LastPerimeterApp.csArenaSystem.ApplyClaimResultWallSystemV2.RebuildPlayablePathClaimedAreaRenderer.MarkDirtylast-perimeter/Tests/Systems/PlayableWallPathTraversalTests.cs
Guided operations
- In the staged app follow the completed trail into
ProcessCompletedTrail; in the final app findCompleteTrailClaimand compare the equivalent handoff. - In the staged app, inspect the
claimResult is nullrecovery for a loop endpoint. Verify that it returns the player to the anchor without committing an arena claim or new path. The final app also displays "NO CAPTURE"; score is added later. - In the final app, follow this order: apply to arena; recompute percentage and score; append capture history; rebuild the playable path; invalidate claimed-area rendering; snap the player onto the rebuilt path; issue feedback; remove eliminated enemies; check the level target.
- Compare the order with the runtime diagram in the plan overview. Explain why the new path cannot be built from old grid state.
- Run the tests in step 3 above, then play through a claim and inspect visual fill and wall traversal. Check score in lesson 10.
Checkpoint
At chapter 06, arena ownership, displayed fill, and movement path agree; score is added later. The lesson 07 tests show a null result does not partially apply.
Common mistakes
- Applying the result twice, which double-counts territory or score.
- Rebuilding the path before applying the claim to the authoritative arena.
- Forgetting to invalidate the cached claimed-area texture.
Questions and extension
Which side effects belong to a transaction's commit stage? Suggest a regression test that would catch a partial update if scoring were moved before validation.

