TLDR
Updating TransitionSpendResourcesNoopTurnRoll, so that it checks possible moves based on both the CatanBankService and CatanGraphService. If a road can be bought, but not legally placed somewhere, TransitionSpendResourcesNoopTurnRoll should not take effect.

Main work
- Updating
TransitionSpendResourcesNoopTurnRollto check for dev card, road, settlement, etc. possible plays. - Scaffolding methods in
CatanGraphServicefor checking road, settlement, and city placement possibilities. - Implementing the
CatanGraphServicemethod that can check for possible road placements.
Challenges
- The graph logic stuff is relatively complex, so took a good chunk of time and could not be done in ~30 minutes like I usually aim for after work.
GraphNodeIndex,GraphNodePiece, andGraphNodeare poorly designed. The graph logic should be simpler than I currently have it.- I will continue pushing through, because I do not want to spend more time finding the “perfect” data structure.
- Overwhelming realizing how much work I have to do and that the majority of what’s remaining is relatively complex business logic.
Learnings
- Although I’m skipping unit / integration testing at the moment, I’ve found that getting even one meaningful manual test working makes me ~90% confident in my implementation.
- Too bad that means if I write five implementations, a bug is 41% likely (
1 - 0.9^5 = 0.40951). In other words,1 - P(complete success) = P(any failure).
- Too bad that means if I write five implementations, a bug is 41% likely (