GC retention fixes

This commit is contained in:
Anuken
2023-12-10 20:01:40 -05:00
parent a0f235b430
commit 1eb70404d7
4 changed files with 40 additions and 21 deletions

View File

@@ -14,15 +14,17 @@ public class Tiles implements Iterable<Tile>{
final Tile[] array;
final Puddle[] puddles;
final Fire[] fires;
public Tiles(int width, int height){
this.array = new Tile[width * height];
this.width = width;
this.height = height;
this.puddles = new Puddle[width * height];
this.fires = new Fire[width * height];
}
public Puddle puddle(int pos){
public Puddle getPuddle(int pos){
return puddles[pos];
}
@@ -30,6 +32,15 @@ public class Tiles implements Iterable<Tile>{
puddles[pos] = p;
}
public Fire getFire(int pos){
return fires[pos];
}
public void setFire(int pos, Fire f){
fires[pos] = f;
}
public void each(Intc2 cons){
for(int x = 0; x < width; x++){
for(int y = 0; y < height; y++){