Better generation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package mindustry.world;
|
||||
|
||||
import arc.func.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
|
||||
@@ -54,6 +55,13 @@ public class Tiles implements Iterable<Tile>{
|
||||
return array[y*width + x];
|
||||
}
|
||||
|
||||
/** @return a tile at coordinates, clamped. */
|
||||
public @NonNull Tile getc(int x, int y){
|
||||
x = Mathf.clamp(x, 0, width - 1);
|
||||
y = Mathf.clamp(y, 0, height - 1);
|
||||
return array[y*width + x];
|
||||
}
|
||||
|
||||
/** @return a tile at an iteration index [0, width * height] */
|
||||
public @NonNull Tile geti(int idx){
|
||||
return array[idx];
|
||||
|
||||
Reference in New Issue
Block a user