v0.6.0: lots more class structure changes to rooms
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user