v0.6.0: lots more class structure changes to rooms

This commit is contained in:
Evan Debenham
2017-03-31 00:52:27 -04:00
parent a9e6eb8108
commit c15316baa2
21 changed files with 680 additions and 272 deletions

View File

@@ -54,7 +54,7 @@ public class Rect {
}
public int square() {
return (right - left) * (bottom - top);
return width() * height();
}
public Rect set( int left, int top, int right, int bottom ) {
@@ -69,6 +69,18 @@ public class Rect {
return set( rect.left, rect.top, rect.right, rect.bottom );
}
public Rect setPos( int x, int y ) {
return set( x, y, x + (right - left), y + (bottom - top));
}
public Rect shift( int x, int y ) {
return set( left+x, top+y, right+x, bottom+y );
}
public Rect resize( int w, int h ){
return set( left, top, left+w, top+h);
}
public boolean isEmpty() {
return right <= left || bottom <= top;
}