Skip to content
Settlers Journal
Go back

Implementing Available Settlement Placement Validation in the Graph

Edit page

TLDR

Implementing the getAvailableSettlementIndices method in CatanGraph, so that the system can validate where Settlement pieces can be placed. Manually testing the implementation logic by manipulating the CatanGame object directly with hardcoded values.

Sketching out some ideas for identifying possible settlement locations.

alt text

Notice below that the debugger shows Settlement indices that the red player could place a settlement at.

alt text alt text alt text alt text

Main work

Challenges

Learnings


Edit page
Share this post on:

Previous Post
City Placement Validation, Double Resource Collection, and Robber Blocking
Next Post
Combining Bank and Graph Checks for Legal Purchase Transitions