示例#1
0
 public void constructTile(int xTile, int yTile) {
   tileIntegrity[xTile][yTile] = ((STONEPHASE - 1) * STONEPHASESTR) - 1.0;
   Tile t = new Tile(xTile, yTile);
   t.id = 4002;
   setTileId(t.x, t.y, wallLayerIndex, t.id);
   dirtyTiles.add(t);
 }
示例#2
0
  // cleans up tiles, returns tiles with new states
  public LinkedList<Tile> cleanDirtyTiles() {
    for (Tile t : dirtyTiles) {
      // for testing purposes, completely wipeout the tile.
      int oldID = getTileId(t.x, t.y, wallLayerIndex) - 1;
      int phase = oldID % STONEPHASE;
      int baseID = oldID - phase;
      int newID;

      if (tileIntegrity[t.x][t.y] == 0.00) newID = baseID + 1;
      else newID = baseID + 1 + (int) (tileIntegrity[t.x][t.y] / STONEPHASESTR) + 1;
      t.id = newID;

      setTileId(t.x, t.y, wallLayerIndex, newID);
    }
    return dirtyTiles;
  }