- a passed-in defined block (a set of turfs, within a square)
- a starting location inside that range of turfs
- a list of turf types to look at which is considered dense or blocking, or a variable name to access (ie: "density") and a value to check for (ie: 1)
It should return if the space around the starting location is completely enclosed in by the passed in list of turf types (or if all the tiles enclosing that share the same variable value). Simple example would be checking to see if player is currently in a room he can't escape out of.
Some use examples of how I would like to be able to use it:
IsEnclosed(block(), locate(), list(/turf/wall, /turf/heavy_wall))
//checks for enclosure around locate() within range block()... returns 1 if enclosed by any combination of /turf/wall and /turf/heavy_wall
IsEnclosed(block(), locate(), /turf/wall)
//checks for enclosure around locate() within range block()... returns 1 if enclosed by /turf/wall
IsEnclosed(block(), locate(), "density", 1)
//checks for enclosure around locate() within range block()... returns 1 if enclosed by tiles with variable density equal to 1
Most of the variable checking bloat I could easily take care of... the part I don't know where to begin with is the logic of knowing that the enclosure has a break in it or not... basically the meat of the algorithm! Where would you begin?
##.###
#.#..#
#..X.#
######
That ^ should return 0 where . is a floor, # is a wall, and X is the starting location
######
#....#
#..X.#
######
That ^ should return 1