mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-04 23:38:28 +07:00
Reorganized code
This commit is contained in:
@ -21,6 +21,15 @@ import static com.riiablo.map2.DT1.Tile.SUBTILE_SIZE;
|
||||
public class Chunk extends BBox implements Poolable, Disposable {
|
||||
static final Pool<Chunk> pool = Pools.get(Chunk.class);
|
||||
|
||||
static final BucketPool<Tile[]> tilePools = BucketPool
|
||||
.builder(Tile[].class)
|
||||
.add(8 * 8)
|
||||
.add(16 * 16)
|
||||
.add(24 * 24)
|
||||
.add(32 * 32)
|
||||
.add(64 * 64)
|
||||
.build();
|
||||
|
||||
public int layers;
|
||||
public int numTiles;
|
||||
public final Tile[][] tiles = new Tile[MAX_LAYERS][];
|
||||
@ -50,15 +59,6 @@ public class Chunk extends BBox implements Poolable, Disposable {
|
||||
pool.free(this);
|
||||
}
|
||||
|
||||
static final BucketPool<Tile[]> tilePools = BucketPool
|
||||
.builder(Tile[].class)
|
||||
.add(8 * 8)
|
||||
.add(16 * 16)
|
||||
.add(24 * 24)
|
||||
.add(32 * 32)
|
||||
.add(64 * 64)
|
||||
.build();
|
||||
|
||||
Chunk init(int layers) {
|
||||
if (this.layers != 0) throw new IllegalStateException("chunk already initialized");
|
||||
this.layers = layers;
|
||||
|
Reference in New Issue
Block a user