use of org.terasology.engine.world.zones.MinMaxLayerThickness in project Terasology by MovingBlocks.
the class LayeredZoneRegionFunctionTest method setup.
@BeforeEach
public void setup() {
parent.addZone(new Zone("Medium sky", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), MEDIUM_SKY))).addZone(new Zone("Low sky", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), LOW_SKY))).addZone(new Zone("Above ground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), ABOVE_GROUND))).addZone(new Zone("Ground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), GROUND))).addZone(new Zone("Shallow underground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), SHALLOW_UNDERGROUND))).addZone(new Zone("Medium underground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), MEDIUM_UNDERGROUND)));
parent.setSeed(12345);
parent.initialize();
ListMultimap<Class<? extends WorldFacet>, FacetProvider> facetProviderChains = ArrayListMultimap.create();
facetProviderChains.put(ElevationFacet.class, (generatingRegion) -> {
ElevationFacet facet = new ElevationFacet(generatingRegion.getRegion(), generatingRegion.getBorderForFacet(ElevationFacet.class));
for (Vector2ic pos : facet.getRelativeArea()) {
facet.set(pos, 100);
}
generatingRegion.setRegionFacet(ElevationFacet.class, facet);
});
Map<Class<? extends WorldFacet>, Border3D> borders = new HashMap<>();
borders.put(ElevationFacet.class, new Border3D(0, 0, 0));
region = new RegionImpl(new BlockRegion(0, 0, 0).expand(4, 4, 4), facetProviderChains, borders, 1);
}
use of org.terasology.engine.world.zones.MinMaxLayerThickness in project Terasology by MovingBlocks.
the class LayeredZoneRegionFunctionTest method testCreation.
@Test
public void testCreation() {
int minWidth = 100;
int maxWidth = 200;
int ordering = 1000;
LayeredZoneRegionFunction function = new LayeredZoneRegionFunction(new MinMaxLayerThickness(minWidth, maxWidth), ordering);
assertEquals(ordering, function.getOrdering());
}
Aggregations