v0.3.0c: added the ability to get all cells from a room

This commit is contained in:
Evan Debenham 2015-06-02 19:50:07 -04:00
parent 40c0d61dfa
commit d14742fda0

View File

@ -137,6 +137,14 @@ public class Room extends Rect implements Graph.Node, Bundlable {
(top + bottom) / 2 + (((bottom - top) & 1) == 1 ? Random.Int( 2 ) : 0) );
}
public HashSet<Integer> getCells(){
HashSet<Point> points = getPoints();
HashSet<Integer> cells = new HashSet<>();
for( Point point : points)
cells.add(point.x + point.y*Level.WIDTH);
return cells;
}
// **** Graph.Node interface ****
@Override