v0.6.3: significant refactoring and performance improvements to fog of war

This commit is contained in:
Evan Debenham
2017-12-26 16:46:44 -05:00
parent acc9fd33d2
commit c290e5fe47
6 changed files with 324 additions and 204 deletions

View File

@@ -99,6 +99,15 @@ public class Rect {
return result;
}
public Rect union( Rect other ){
Rect result = new Rect();
result.left = Math.min( left, other.left );
result.right = Math.max( right, other.right );
result.top = Math.min( top, other.top );
result.bottom = Math.max( bottom, other.bottom );
return result;
}
public Rect union( int x, int y ) {
if (isEmpty()) {
return set( x, y, x + 1, y + 1 );