Settlers Journal
RSS FeedSettlers Journal documents the development process for a Settlers of Catan web application. It includes implementation details, challenges faced, solutions, and lessons learned. The main goal of this project is to build in the open and show how much goes into a seemingly simple application.
Check out the about page before diving into the individual posts, if you need more context about the project.
Featured
-
API Calls Based on Player Action
Frontend work. Created `PlayerActionService` for handling orchestrating API calls based on the action a user clicks. Implemented this using `Observable<T>` from RxJS, rather than `Promise<T>`.
Recent Posts
-
City Placement Validation, Double Resource Collection, and Robber Blocking
Implementing getAvailableCityIndices in CatanGraphService, adding an isCity field to the Settlement model to double resource collection for cities, and updating resource gathering to skip hexagons blocked by the Robber.
-
Implementing Available Settlement Placement Validation in the Graph
Writing getAvailableSettlementIndices in CatanGraph with brute-force validation across all board positions, and reflecting on how sparse graph design and mixed key types made the implementation more complex than necessary.
-
Combining Bank and Graph Checks for Legal Purchase Transitions
Updating the spend-resources NOOP transition to validate that purchasable items can also be legally placed on the board, and implementing road placement availability checks in CatanGraphService.
-
Checking Purchase Eligibility with CatanBankService Before Turn Transitions
Adding a NOOP transition that checks whether any purchases are possible before rolling, introducing CatanBankService for resource-cost comparisons, and fixing an immutable list bug in the player's available actions setter.
-
Implementing Resource Collection from Dice Rolls for All Players
Updating RollAction to query CatanGraphService for settlements adjacent to the rolled hexagons and distributing the correct resources to each player's ResourceBundle after every dice roll.
-
Introducing Integration Tests and Improving Action and Transition Coverage
Scaffolding a Java integration test structure that makes real HTTP requests against the controller, adding the first Transition tests, and using try-with-resources for clean MockedStatic teardown between tests.
-
Expanding Test Coverage to Multiple Actions and the Spring Controller
Using ChatGPT to scaffold unit tests for multiple Action classes and the CatanController, and investigating unexpected Spring request body serialization behavior with @RequestBody and custom DTOs.
-
Writing Unit Tests for PlaceSettlementAction
Writing unit tests for PlaceSettlementAction by thinking through meaningful test cases, setting up game state fixtures, and using ChatGPT to scaffold new test files based on existing IAction test patterns.