I've created Mine Sweeper in UE4 by c++ that you can learn how I used Flood-fill algorithm to find how the tiles are connected to
...