mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 06:11:24 +00:00
use search range for binary column in pattern locator
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ public class AdjacentPatternLocator implements Locator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BinaryColumn getSuitableCoordinates(Column<?> column) {
|
public BinaryColumn getSuitableCoordinates(Column<?> column) {
|
||||||
BinaryColumn locations = new BinaryColumn(column.getMinY(), column.getMaxY());
|
BinaryColumn locations = new BinaryColumn(search);
|
||||||
|
|
||||||
for(int y : search) {
|
for(int y : search) {
|
||||||
if(isValid(y, column)) locations.set(y);
|
if(isValid(y, column)) locations.set(y);
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
package com.dfsek.terra.api.structure.feature;
|
package com.dfsek.terra.api.structure.feature;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.Range;
|
||||||
|
|
||||||
import java.util.function.IntConsumer;
|
import java.util.function.IntConsumer;
|
||||||
|
|
||||||
|
|
||||||
@@ -28,6 +30,10 @@ public class BinaryColumn {
|
|||||||
this.data = new boolean[maxY - minY];
|
this.data = new boolean[maxY - minY];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BinaryColumn(Range y) {
|
||||||
|
this(y.getMin(), y.getMax());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of a height to {@code true}.
|
* Set the value of a height to {@code true}.
|
||||||
* @param y Height of entry to set.
|
* @param y Height of entry to set.
|
||||||
|
|||||||
Reference in New Issue
Block a user