So, in a small project I'm whipping up, I'll want to check if rooms are sealed. The game will be using a tile system, which simplifies things. If an empty area is surrounded by filled tiles, it's considered sealed.
The tiles for each structure will be stored in a table of tables of tables of values. (sloppy, I know)
A table for each Y-level, containing tables for each Z-level, containing values for each tile (only filled tiles, empty tiles will be nil).
I'm wondering what the most efficient way for determining whether or not a room is sealed would be.
Given a tile's coordinates, I'd like to see if that position is in a surrounded room.
I know I could do this by going through each tile radiating, outwards from the point until they hit walls, counting the walls, then checking positions to see if the walls seal the room. But there has to be a more efficient way. Maybe something along the lines of checking a straight line in one direction until it hits a wall, then following along walls.
All I'm really asking for is ideas and input. I'm not asking for you to script anything.
