Pattern boolean operations

This commit is contained in:
dfsek
2021-07-27 19:39:53 -07:00
parent 7430116fa9
commit fb3f90a9cd

View File

@@ -4,4 +4,12 @@ import com.dfsek.terra.api.world.Column;
public interface Pattern {
boolean matches(int y, Column column);
default Pattern and(Pattern that) {
return (y, column) -> this.matches(y, column) && that.matches(y, column);
}
default Pattern or(Pattern that) {
return (y, column) -> this.matches(y, column) || that.matches(y, column);
}
}