public static void updateMap( int cell ) { if (scene != null) { scene.tiles.updated.union(cell % Level.WIDTH, cell / Level.WIDTH); } }
public static void updateMap( boolean[] visible ) { if (scene != null) { for( int i = 0 ; i < visible.length ; i++ ) { if( visible[i] ) { scene.tiles.updated.union(i % Level.WIDTH, i / Level.WIDTH); } } } }
public synchronized void updateMapCell(int cell){ updated.union( cell % mapWidth, cell / mapWidth ); }
public Rect union( Point p ) { return union( p.x, p.y ); }
public synchronized void updateMapCell(int cell){ updated.union( cell % mapWidth, cell / mapWidth ); }
public Rect union( Point p ) { return union( p.x, p.y ); }
public Rect union( Point p ) { return union( p.x, p.y ); }
public synchronized void updateFog(Rect update){ for (Rect r : toUpdate.toArray(new Rect[0])){ if (!r.intersect(update).isEmpty()){ toUpdate.remove(r); toUpdate.add(r.union(update)); return; } } toUpdate.add(update); }
public synchronized void updateFog(Rect update){ for (Rect r : toUpdate.toArray(new Rect[0])){ if (!r.intersect(update).isEmpty()){ toUpdate.remove(r); toUpdate.add(r.union(update)); return; } } toUpdate.add(update); }
public void setupArea(){ for (int cell=0; cell < cur.length; cell++) { if (cur[cell] != 0){ area.union(cell%Dungeon.level.width(), cell/Dungeon.level.width()); } } }
public void setupArea(){ for (int cell=0; cell < cur.length; cell++) { if (cur[cell] != 0){ area.union(cell%Dungeon.level.width(), cell/Dungeon.level.width()); } } }
private void spreadFromCell( int cell, int power ){ if (cur[cell] == 0) { area.union(cell % Dungeon.level.width(), cell / Dungeon.level.width()); } cur[cell] = Math.max(cur[cell], power); for (int c : PathFinder.NEIGHBOURS4){ if (water[cell + c] && cur[cell + c] < power){ spreadFromCell(cell + c, power); } } }
private void spreadFromCell( int cell, int power ){ if (cur[cell] == 0) { area.union(cell % Dungeon.level.width(), cell / Dungeon.level.width()); } cur[cell] = Math.max(cur[cell], power); for (int c : PathFinder.NEIGHBOURS4){ if (water[cell + c] && cur[cell + c] < power){ spreadFromCell(cell + c, power); } } }
public void seed( Level level, int cell, int amount ) { if (cur == null) cur = new int[level.length()]; if (off == null) off = new int[cur.length]; cur[cell] += amount; volume += amount; area.union(cell%level.width(), cell/level.width()); }
public void seed( Level level, int cell, int amount ) { if (cur == null) cur = new int[level.length()]; if (off == null) off = new int[cur.length]; cur[cell] += amount; volume += amount; area.union(cell%level.width(), cell/level.width()); }
fire = 4; burn( cell ); area.union(i, j); } else { fire = 0;
fire = 4; burn( cell ); area.union(i, j); } else { fire = 0;