mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-22 08:07:51 +00:00
create Column interface
This commit is contained in:
1 parent
d93f11b5f2
commit
c46f84a00e
1 file changed
+18
@@ -0,0 +1,18 @@
|
||||
package com.dfsek.terra.api.util;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
public interface Column<T> {
|
||||
int getMinY();
|
||||
|
||||
int getMaxY();
|
||||
|
||||
T get(int y);
|
||||
|
||||
default void forEach(Consumer<T> consumer) {
|
||||
for(int y = getMinY(); y < getMaxY(); y++) {
|
||||
consumer.accept(get(y));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user