Isn't 2D-Floodfill all you need? If you start at your castle and a floodfill can reach a point outside the visible area (a invisible line/row out of the battlefield will do it), then your walls are not closed.
Ok, this would be a bruteforce approach, but assuming a grid like 20x20 or so it would be fast anyway.
Maybe I don't understand fully what you want to do. I played rampart ages ago...
Ok, this would be a bruteforce approach, but assuming a grid like 20x20 or so it would be fast anyway.
Maybe I don't understand fully what you want to do. I played rampart ages ago...