TLDR
Adding TransitionSpendResourcesNoopTurnRoll, which checks if a player can make any kind of purchase. E.g., buy a dev card, build a road, etc. Introducing CatanBankService. Refactoring setAvailableActions method to avoid immutable list issue.

Main work
- Creating
TransitionSpendResourcesNoopTurnRolland adding it to the FSM definition. - Introducing the
CatanBankServiceto check when player resources are sufficient for purchases. - Updating static fields on
CatanGameto contain the hardcoded resource counts for dev cards, roads, settlements, cities, and 4-for-1 trades. - Updating
ResourceBundlewith agreaterThanOrEqualToutility method. - Updating the
setAvailableActionssetter onPlayerto handle variable arguments more gracefully.
Challenges
- There are a lot of considerations when making purchases. Not only will the bank service be needed, but it will need to be integrated with the graph service to check if a player can both, e.g., buy a road and place it in a legal position.
- Had a bug where
myList.clear()was not a supported operation, because the underlying list was created withList.of(...)and therefore immutable.- This caused me to update the
setAvailableActionsmethod so that it handled the list initialization, rather than the caller.
- This caused me to update the
Learnings
- As mentioned in the previous entry, testing this will take more time than I have.
- I am still ok with that - there will likely be sweeping refactoring I do once the game logic is stable and persistence / auth is introduced.