Added prototype planet sector land system
This commit is contained in:
@@ -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);
|
||||
|
||||
19
core/src/mindustry/world/TileGen.java
Normal file
19
core/src/mindustry/world/TileGen.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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++){
|
||||
|
||||
Reference in New Issue
Block a user