if (currHex.containsExit(dir)) { needsUpdate.add(new Coords(Coords.xInDir(x, y, dir), Coords.yInDir(x, y, dir)));
/** * Determines if this Board contains the (x, y) Coords, and if so, sets the * specified Hex into that position and initializes it. * * @param x * the x Coords. * @param y * the y Coords. * @param hex * the hex to be set into position. */ public void setHex(int x, int y, IHex hex) { data[(y * width) + x] = hex; initializeHex(x, y); // If this hex has exitable terrain, we may need to update the exits in // adjacent hexes if (hex.hasExitableTerrain()) { for (int dir = 0; dir < 6; dir++) { if (hex.containsExit(dir)) { initializeInDir(x, y, dir); } } } }