mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-21 15:50:40 +00:00
Pattern boolean operations
This commit is contained in:
@@ -4,4 +4,12 @@ import com.dfsek.terra.api.world.Column;
|
|||||||
|
|
||||||
public interface Pattern {
|
public interface Pattern {
|
||||||
boolean matches(int y, Column column);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user