Esempio n. 1
0
 private void renderFullBoardRecursive(
     Graphics g, AbstractList<Space> finished, Space origin, int x, int y, Board b) {
   renderSpace(g, origin, x, y);
   Board.Coordinates coord = b.new Coordinates(x, y);
   Developer dev = b.getDeveloper(coord);
   if (dev != null) {
     renderDeveloper(dev, x, y);
   }
   if (origin.getTop() != null && !finished.contains(origin.getTop())) {
     finished.add(origin.getTop());
     renderFullBoardRecursive(g, finished, origin.getTop(), x, y - 1, b);
   }
   if (origin.getLeft() != null && !finished.contains(origin.getLeft())) {
     finished.add(origin.getLeft());
     renderFullBoardRecursive(g, finished, origin.getLeft(), x - 1, y, b);
   }
   if (origin.getRight() != null && !finished.contains(origin.getRight())) {
     finished.add(origin.getRight());
     renderFullBoardRecursive(g, finished, origin.getRight(), x + 1, y, b);
   }
   if (origin.getBottom() != null && !finished.contains(origin.getBottom())) {
     finished.add(origin.getBottom());
     renderFullBoardRecursive(g, finished, origin.getBottom(), x, y + 1, b);
   }
   int givenHeight = origin.getHeight();
   if (origin.getHeight() > 0 && origin.getTile().getType() == TileType.PALACE) {
     givenHeight = ((PalaceTile) origin.getTile()).getLevel();
   }
   spaceHeights[x][y] = givenHeight;
   renderText(
       g, "" + givenHeight, (x + 1) * TILE_WIDTH, (y + 1) * TILE_HEIGHT + g.getFont().getSize());
 }
Esempio n. 2
0
 public boolean contains(Object o) {
   return adapter.contains(o);
 }