icfp-model/src/main/java/ru/bosony/model/mine/Mine.java
changeset 40 daa0ff48b7d0
parent 31 6f587e61e1a2
child 43 937f4434f526
equal deleted inserted replaced
39:27b98e729716 40:daa0ff48b7d0
   218 		for (Coordinate coordinate : cell.getCoordinate().getNeighboringCoordinates())
   218 		for (Coordinate coordinate : cell.getCoordinate().getNeighboringCoordinates())
   219 			cells.add(getCell(coordinate));
   219 			cells.add(getCell(coordinate));
   220 		return cells;
   220 		return cells;
   221 	}
   221 	}
   222 
   222 
       
   223 	public Set<Cell> getAdjacentCells(Cell cell) {
       
   224 		Set<Cell> cells = new HashSet<Cell>();
       
   225 		for (Coordinate coordinate : cell.getCoordinate().getAdjacentCoordinates())
       
   226 			cells.add(getCell(coordinate));
       
   227 		return cells;
       
   228 	}
       
   229 
   223 	public Set<Cell> findCells(CellContent content) {
   230 	public Set<Cell> findCells(CellContent content) {
   224 		Set<Cell> finded = new HashSet<Cell>();
   231 		Set<Cell> finded = new HashSet<Cell>();
   225 		for (int y = sizeY - 1; y >= 0; y--) {
   232 		for (int y = sizeY - 1; y >= 0; y--) {
   226 			for (int x = 0; x < sizeX; x++) {
   233 			for (int x = 0; x < sizeX; x++) {
   227 				if (cells[x][y].getContent() == content)
   234 				if (cells[x][y].getContent() == content)