create Column interface

This commit is contained in:
dfsek 2022-06-08 18:27:08 -07:00
parent d93f11b5f2
commit c46f84a00e

View File

@ -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));
}
}
}