Archives
All the articles I've archived.
-
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.
-
Implementing the New FSM Transition Design with Regression Testing
Translating existing States, Glides, and Transitions into the simplified Transition-first FSM design, introducing ActionEnum.NOOP for free transitions, and manually regression testing the results through CLI automation scripts.
-
Simplifying the FSM by Removing Glides and Adopting ActionEnum.NOOP
Redesigning the Finite State Machine to eliminate Glides and StateBase, representing free transitions with ActionEnum.NOOP, and adopting a strategy-pattern ActionEnum that delegates to concrete action implementations.
-
Printing the FSM Definition at Startup and Discovering a Design Code Smell
Adding startup logging to print all FSM transitions for visibility, then uncovering a design smell where Glides duplicate information from parent Actions—motivating a refactor that removes StateBase and replaces Glides with enriched Transitions.
-
Improving CatanGraph Test Coverage and Catching a HashMap Overwrite Bug
Expanding CatanGraph unit tests to cover all branches, overriding equals and hashCode on ResourceBundle for readable assertions, and discovering a real bug where Road adjacency entries were silently overwritten by Hexagon entries in a HashMap.
-
Introducing ResourceBundle for Player Resources and Expanding Unit Test Coverage
Creating a ResourceBundle class to encapsulate each player's resource cards, using Jackson's @JsonUnwrapped for clean JSON serialization, and mocking random roll results in unit tests with Mockito's MockedStatic.
-
Refactoring Graph Data Structures and Loading Board Layout from Files
Updating CatanGraph to use full GraphNode objects as HashMap keys, adding Hexagons into the graph structure for easier adjacency lookups, and reading hardcoded board adjacency data from JSON resource files instead.
-
Full-Stack Road Placement and Builder Pattern for the FSM
Adding road placement to the Angular frontend by reusing and refactoring existing settlement placement code, while reworking the FSM data structures in Java with a step-based Builder pattern for safer initialization.
-
Implementing Place Road Action and Cleaning Up API Call Logic
Retroactive entry: implementing the 'place road' player action in the backend, refactoring API call logic for reuse across actions, and cleaning up FSM data structures with the builder pattern.
-
Two-Phase Player Actions and Angular Event Bubbling Through the Component Tree
Implementing two-phase player actions where clicking an action then requires selecting a board piece, and wiring up Angular event emitters from Settlement through SettlementGrid up to the Board component to handle the selection.
-
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>`.
-
Angular Routing, Login Page, and Wiring Up Player Action Clicks
Building a login landing page, configuring Angular routes between pages, and scaffolding event emitters so player action clicks propagate up the component hierarchy to trigger REST API calls.
-
Interactive Board Pieces with Hover States and Probability Coloring
Adding click and hover event listeners to Settlements, Roads, and Centers, applying a red-to-green gradient on Center pieces to visually represent roll probabilities, and updating player cards to display available actions.
-
Configuring Java Test Tooling and Reaching 44% Code Coverage
Adding Maven surefire and Jacoco plugins for test reports and coverage metrics, then writing the first unit tests for IAction and CatanGraph to bring code coverage from 0% to 44%.
-
Adding the Barter Offer State and Reworking SKIP Action Logic
Introducing TURN_BARTER_OFFER with DTOs and a new REST endpoint, updating SKIP to behave as a true no-op instruction in the FSM, and revisiting the project after a month-long break from Java development.
-
Implementing Turn Roll, Robber, and Barter State Transitions
Adding FSM states and transitions for the full turn-roll flow including paths to TURN_ROBBER and TURN_BARTER, adding victory points and robber position to the game model, and identifying the growing need for unit test coverage.
-
Tracking Player Resources and Collecting Free Starting Resources from Settlements
Extending the Player model with a resource card map and updating PLACE_FREE_SETTLEMENT logic so players automatically collect resources from their second-placed settlement, per Catan rules.
-
Refactoring Hexagon State into a Unified Model
Consolidating hexagon resource type and roll number into a single Hexagon object on both the Java backend and Angular frontend, and working around a TypeScript typing limitation with HashMap-backed dictionaries.
-
Multi-Outcome FSM Transitions and Completing Initial Settlement Placement
Introducing 'Glide' objects to handle FSM actions that can lead to multiple possible next states, then fully implementing the snake-draft PLACE_FREE_SETTLEMENT and PLACE_FREE_ROAD flow so the game can officially begin.
-
Roll-for-Order Gameplay and Finite State Machine Cleanup
Implementing roll-for-order functionality, updating player and game state models with join order tracking, and refactoring the FSM base from an interface to an abstract class to cleanly support free transitions.
-
Adding Player Join Order, Colors, and a Game Event Log
Tracking the order players join the lobby to automatically assign game colors, recording every FSM action and free transition in a running event log on the game model, and adding a minimum-player SKIP shortcut for the lobby.
-
Building a Python CLI Tool and Automated Game Scenario Runner
Creating a two-part Python testing setup: a CLI wrapper around the REST API and a script runner that replays sequences of game commands from text files, enabling fast manual regression testing and informal game move notation.
-
Connecting Angular Frontend to Spring Backend with a Randomized Board
Synchronizing GameState models between the Angular frontend and Java backend to enable live polling, and implementing Catan-rules-compliant random board shuffling using Java's Collections.shuffle.
-
Pseudo-Coding OOP Relationships Between FSM States and Actions
Translating the finalized game flow design into concrete Java class relationships—how FSM States and Actions relate to GameService and GameController—while safely deferring auth and persistence until game logic is stable.
-
Mapping REST API Design to the Catan Finite State Machine
A focused design session working through the full Catan ruleset and sketching how a REST API maps to the proposed FSM—what actions the API should expose and how the state machine handles them in a scalable, maintainable way.
-
Implementing the Game Service and Discovering the Bruno API Client
Creating the CatanGameService with game state and action enums as the backbone of the eventual FSM, and switching to Bruno as a local-first, open-source alternative to Postman for making REST requests.
-
Scaffolding the Java Spring Backend and Connecting to Postgres
Setting up a Java Spring project with JDBC, Flyway migrations, and Spring Web, then installing Postgres locally and running the first end-to-end REST test via curl and the IntelliJ debugger.
-
Designing Game State Persistence and a Custom Finite State Machine
Architecture session diagramming how Catan game state could be stored in a relational database and how player actions can be validated and broadcast. Evaluated Spring State Machine and chose a simpler custom FSM approach for MVP.
-
Adding Roads, Player Cards, and Resource-Based Coloring to the Board
Implementing Road pieces as the third positional grid on the Catan board, conditionally styling hexagons and player cards by resource type and player color, and refactoring all piece types into proper Angular components with shared game state.
-
Board Geometry for Center Pieces and Neovim Productivity
Organizing CSS and TypeScript constants for board layout geometry, reworking hexagon formulas to correctly position Center pieces, and continuing Neovim IDE configuration while balancing it against actual feature work.
-
Configuring Neovim and Scaffolding the Angular Frontend
Setting up a Neovim IDE from scratch with TypeScript and Angular LSP support, then scaffolding the Angular project with the hexagon CSS from earlier prototyping. Working through the geometry math for positioning Settlement pieces on the board.
-
Prototyping a Catan Hexagon Grid with HTML and CSS
Exploring CSS clip-path and linear-gradient techniques to render a hexagon grid using JSFiddle for rapid prototyping. Initial review of the Catan board layout and the challenges of responsive absolute positioning.