public void populate(PhaseI currentPhase) { if (hexMap == null) hexMap = orUIManager.getMapPanel().getMap(); GUIHex uiHex = hexMap.getSelectedHex(); MapHex hex = uiHex.getHexModel(); orUIManager.tileUpgrades = new ArrayList<TileI>(); List<TileI> tiles; Set<String> allowedColours = currentPhase.getTileColours().keySet(); for (LayTile layTile : hexMap.getTileAllowancesForHex(hex)) { tiles = layTile.getTiles(); if (tiles == null) { for (TileI tile : uiHex .getCurrentTile() .getValidUpgrades(hex, orUIManager.gameUIManager.getCurrentPhase())) { // Skip if not allowed in LayTile // if (!layTile.isTileColourAllowed(tile.getColourName())) continue; if (!orUIManager.tileUpgrades.contains(tile)) orUIManager.tileUpgrades.add(tile); } } else { for (TileI tile : tiles) { // Skip if colour is not allowed yet if (!allowedColours.contains(tile.getColourName())) continue; if (!orUIManager.tileUpgrades.contains(tile)) orUIManager.tileUpgrades.add(tile); } } } }