mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
Pattern boolean operations
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user