MovePath movePath, IBoard board, StringBuilder logMsg) { logMsg.append("\n\tHex ").append(hex.getCoords().toFriendlyString());
/** * Returns a list of orthographic images to be tiled above the hex. As noted * above, all matches must be 1.0, and if such a match is achieved, all terrain * elements from the tileset hex are removed from the hex. Thus you want to pass * a copy of the original to this function. */ private List<Image> orthoFor(IHex hex, Component comp) { ArrayList<Image> matches = new ArrayList<Image>(); // find orthographic image matches for (HexEntry entry : orthos) { if (orthoMatch(hex, entry.getHex()) >= 1.0) { Image img = entry.getImage(comp, hex.getCoords().hashCode()); if (img != null) { matches.add(img); } else { matches.add(ImageUtil.createAcceleratedImage(HEX_W, HEX_H)); } // remove involved terrain from consideration for (int terr : entry.getHex().getTerrainTypes()) { if (entry.getHex().containsTerrain(terr)) { hex.removeTerrain(terr); } } } } return matches; }
/** * Returns a list of images to be superimposed on the hex. As noted above, all * matches must be 1.0, and if such a match is achieved, all terrain elements * from the tileset hex are removed from the hex. Thus you want to pass a copy * of the original to this function. */ private List<Image> supersFor(IHex hex, Component comp) { ArrayList<Image> matches = new ArrayList<Image>(); // find superimposed image matches for (HexEntry entry : supers) { if (superMatch(hex, entry.getHex()) >= 1.0) { Image img = entry.getImage(comp, hex.getCoords().hashCode()); if (img != null) { matches.add(img); } else { matches.add(ImageUtil.createAcceleratedImage(HEX_W, HEX_H)); } // remove involved terrain from consideration for (int terr : entry.getHex().getTerrainTypes()) { if (entry.getHex().containsTerrain(terr)) { hex.removeTerrain(terr); } } } } return matches; }
Image img = bestMatch.getImage(comp, hex.getCoords().hashCode()); if (img == null) { img = ImageUtil.createAcceleratedImage(HEX_W, HEX_H);
Mockito.when(mockHexThree.getTerrainTypes()).thenReturn(new int[0]); Mockito.when(mockFinalHex.getTerrainTypes()).thenReturn(new int[0]); Mockito.when(mockHexOne.getCoords()).thenReturn(testCoordsOne); Mockito.when(mockHexTwo.getCoords()).thenReturn(testCoordsTwo); Mockito.when(mockHexThree.getCoords()).thenReturn(testCoordsThree); Mockito.when(mockFinalHex.getCoords()).thenReturn(testFinalCoords);
int targetHeightAdjustment = game.hasRooftopGunEmplacement(targetHex.getCoords()) ? 1 : 0;