Added prototype planet sector land system

This commit is contained in:
Anuken
2020-01-20 12:05:26 -05:00
parent 01e7397df5
commit 27d6bf067e
17 changed files with 1902 additions and 1734 deletions

View File

@@ -37,17 +37,21 @@ public class Tile implements Position, TargetTrait{
block = floor = overlay = (Floor)Blocks.air;
}
public Tile(int x, int y, int floor, int overlay, int wall){
public Tile(int x, int y, Block floor, Block overlay, Block wall){
this.x = (short)x;
this.y = (short)y;
this.floor = (Floor)content.block(floor);
this.overlay = (Floor)content.block(overlay);
this.block = content.block(wall);
this.floor = (Floor)floor;
this.overlay = (Floor)overlay;
this.block = wall;
//update entity and create it if needed
changed();
}
public Tile(int x, int y, int floor, int overlay, int wall){
this(x, y, content.block(floor), content.block(overlay), content.block(wall));
}
/** Returns this tile's position as a {@link Pos}. */
public int pos(){
return Pos.get(x, y);

View File

@@ -0,0 +1,19 @@
package mindustry.world;
import mindustry.content.*;
public class TileGen{
public Block floor;
public Block block ;
public Block overlay;
{
reset();
}
public void reset(){
floor = Blocks.stone;
block = Blocks.air;
overlay = Blocks.air;
}
}

View File

@@ -1,5 +1,6 @@
package mindustry.world;
import arc.func.*;
import arc.util.ArcAnnotate.*;
import java.util.*;
@@ -16,6 +17,14 @@ public class Tiles implements Iterable<Tile>{
this.height = height;
}
public void each(Intc2 cons){
for(int x = 0; x < width; x++){
for(int y = 0; y < height; y++){
cons.get(x, y);
}
}
}
/** fills this tile set with empty air tiles. */
public void fill(){
for(int i = 0; i < array.length; i++){