Editor experimental sector generator

This commit is contained in:
Anuken
2022-01-22 15:06:46 -05:00
parent 97da66cd44
commit fdcc373813
11 changed files with 145 additions and 15 deletions

View File

@@ -408,7 +408,7 @@ public abstract class BasicGenerator implements WorldGenerator{
if(cx*cx + cy*cy <= r2){
Tile other = tiles.get(tile.x + cx, tile.y + cy);
if(other != null){
if(other != null && other.floor() != floor){
other.setFloor(dest);
}
}

View File

@@ -30,10 +30,10 @@ public class BlankPlanetGenerator extends PlanetGenerator{
}
@Override
public void generate(Tiles tiles, Sector sec){
public void generate(Tiles tiles, Sector sec, int seed){
this.tiles = tiles;
this.sector = sec;
this.rand.setSeed(sec.id);
this.rand.setSeed(sec.id + seed + baseSeed);
tiles.fill();

View File

@@ -16,6 +16,9 @@ import mindustry.world.*;
import static mindustry.Vars.*;
public abstract class PlanetGenerator extends BasicGenerator implements HexMesher{
public int baseSeed = 0;
public int seed = 0;
protected IntSeq ints = new IntSeq();
protected Sector sector;
@@ -128,10 +131,11 @@ public abstract class PlanetGenerator extends BasicGenerator implements HexMeshe
return res % 2 == 0 ? res : res + 1;
}
public void generate(Tiles tiles, Sector sec){
public void generate(Tiles tiles, Sector sec, int seed){
this.tiles = tiles;
this.seed = seed + baseSeed;
this.sector = sec;
this.rand.setSeed(sec.id);
this.rand.setSeed(sec.id + seed + baseSeed);
TileGen gen = new TileGen();
tiles.each((x, y) -> {