I have a 2d game map consisting of several 'rooms'
For example, here is a 2D map grid: (Brown cells = wall tiles)
If I click on a tile (that isn't brown), I would like to obtain an array of all the cells in the region that I clicked. (If the region is bounded by brown tiles, otherwise do nothing)
For example, there are two regions in the image above, both colored in grey. If I clicked cell (4,4) I would get a 4x5 array of cells starting at (3,3).
Does anyone know a good performance efficient algorithm for this? I need to account for non-square rooms ideally.