mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 14:00:14 +00:00
Pattern boolean operations
This commit is contained in:
1 parent
7430116fa9
commit
fb3f90a9cd
1 file changed
+8
+8
@@ -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