Skip to content

Extracted efficient 'tile-grid.gd' model.

argonvile requested to merge extract-tile-grid into main

The old combo calculations in game-board.gd were recursive and O(N^2) or worse, as we constantly had to evaluate which groups were formed with which nodes. The new model is more efficient and calculates node groups a single time. Populating the model is done in O(N) time and only needs to be done once.

I've extracted this new model into its own script, as the logic for populating it is complex. This lets us free up game-board.gd for UI-specific logic, such as handling mouse clicks and button presses.

Merge request reports

Loading