private List<TilePanel> getValidMovementPanels(Tile from, Unit unit) { List<TilePanel> result = new ArrayList<TilePanel>(); List<Position> validMoves = movementStrategy.getValidMoves(unit, from.getPosition(), unitMap); for (Position validMove : validMoves) { TilePanel e = map.get(board.getTileAtPosition(validMove)); if (e != null) { result.add(e); } } return result; }
public void tileChanged(Position p) { map.get(board.getTileAtPosition(p)).repaint(); }