v0.3.0c: added the ability to get all cells from a room
This commit is contained in:
parent
40c0d61dfa
commit
d14742fda0
|
@ -137,6 +137,14 @@ public class Room extends Rect implements Graph.Node, Bundlable {
|
||||||
(top + bottom) / 2 + (((bottom - top) & 1) == 1 ? Random.Int( 2 ) : 0) );
|
(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 ****
|
// **** Graph.Node interface ****
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user