Explorar el Código

Delete stuff I don't use + correct errors in Javadoc blocking its html generation

smelc hace 6 años
padre
commit
6a251a4c1e

+ 0 - 339
squidlib-util/src/main/java/squidpony/GwtCompatibility.java

@@ -2,10 +2,6 @@ package squidpony;
 
 import squidpony.squidmath.Coord;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-
 /**
  * Static methods useful to be GWT-compatible, and also methods useful for filling gaps in Java's support for arrays.
  * You can think of the purpose of this class as "GWT, and Compatibility". There's a replacement for a Math method that
@@ -59,339 +55,4 @@ public class GwtCompatibility {
         return r;
     }
 
-    /**
-     * Stupidly simple convenience method that produces a range from start to end, not including end, as an int array.
-     * @param start the inclusive lower bound on the range
-     * @param end the exclusive upper bound on the range
-     * @return the range of ints as an int array
-     */
-    public static int[] range(int start, int end)
-    {
-        if(end - start <= 0)
-            return new int[0];
-        int[] r = new int[end - start];
-        for (int i = 0, n = start; n < end; i++, n++) {
-            r[i] = n;
-        }
-        return r;
-    }
-
-    private static final char[] letters = {
-            'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a',
-            'b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','À','Á',
-            'Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý',
-            'Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','ø','ù',
-            'ú','û','ü','ý','þ','ÿ','Ā','ā','Ă','ă','Ą','ą','Ć','ć','Ĉ','ĉ','Ċ','ċ','Č','č','Ď','ď','Đ','đ','Ē','ē','Ĕ',
-            'ĕ','Ė','ė','Ę','ę','Ě','ě','Ĝ','ĝ','Ğ','ğ','Ġ','ġ','Ģ','ģ','Ĥ','ĥ','Ħ','ħ','Ĩ','ĩ','Ī','ī','Ĭ','ĭ','Į','į',
-            'İ','ı','Ĵ','ĵ','Ķ','ķ','ĸ','Ĺ','ĺ','Ļ','ļ','Ľ','ľ','Ŀ','ŀ','Ł','ł','Ń','ń','Ņ','ņ','Ň','ň','ʼn','Ō','ō','Ŏ',
-            'ŏ','Ő','ő','Œ','œ','Ŕ','ŕ','Ŗ','ŗ','Ř','ř','Ś','ś','Ŝ','ŝ','Ş','ş','Š','š','Ţ','ţ','Ť','ť','Ŧ','ŧ','Ũ','ũ',
-            'Ū','ū','Ŭ','ŭ','Ů','ů','Ű','ű','Ų','ų','Ŵ','ŵ','Ŷ','ŷ','Ÿ','Ź','ź','Ż','ż','Ž','ž','Ǿ','ǿ','Ș','ș','Ț','ț',
-            'Γ','Δ','Θ','Λ','Ξ','Π','Σ','Φ','Ψ','Ω','α','β','γ'},
-            empty = new char[0];
-
-    /**
-     * Stupidly simple convenience method that produces a char range from start to end, including end, as a char array.
-     * @param start the inclusive lower bound on the range, such as 'a'
-     * @param end the inclusive upper bound on the range, such as 'z'
-     * @return the range of chars as a char array
-     */
-    public static char[] charSpan(char start, char end)
-    {
-        if(end - start <= 0)
-            return empty;
-        if(end == 0xffff)
-        {
-
-            char[] r = new char[0x10000 - start];
-            for (char i = 0, n = start; n < end; i++, n++) {
-                r[i] = n;
-            }
-            r[0xffff - start] = 0xffff;
-            return r;
-        }
-        char[] r = new char[end - start + 1];
-        for (char i = 0, n = start; n <= end; i++, n++) {
-            r[i] = n;
-        }
-        return r;
-    }
-    /**
-     * Stupidly simple convenience method that produces a char array containing only letters that can be reasonably
-     * displayed (with SquidLib's default text display assets, at least). The letters are copied from a single source
-     * of 256 chars; if you need more chars or you don't need pure letters, you can use {@link #charSpan(char, char)}.
-     * @param charCount the number of letters to return in an array; the maximum this will produce is 256
-     * @return the range of letters as a char array
-     */
-    public static char[] letterSpan(int charCount)
-    {
-        if(charCount <= 0)
-            return empty;
-        char[] r = new char[Math.min(charCount, 256)];
-        System.arraycopy(letters, 0, r, 0, r.length);
-        return r;
-    }
-
-    /**
-     * Gets the first item in an Iterable of T, or null if it is empty. Meant for collections like LinkedHashSet, which
-     * can promise a stable first element but don't provide a way to access it. Not exactly a GWT compatibility method,
-     * but more of a Java standard library stand-in. Even though LinkedHashSet does not support this out-of-the-box,
-     * OrderedSet already provides a first() method.
-     * @param collection an Iterable of T; if collection is null or empty this returns null
-     * @param <T> any object type
-     * @return the first element in collection, or null if it is empty or null itself
-     */
-	public static <T> T first(Iterable<T> collection)
-    {
-        if(collection == null)
-            return null;
-        Iterator<T> it = collection.iterator();
-        if(it.hasNext())
-            return it.next();
-        return null;
-    }
-
-	/**
-	 * Gets a copy of the 2D char array, source, that has the same data but shares no references with source.
-	 * @param source a 2D char array
-	 * @return a copy of source, or null if source is null
-	 */
-	public static char[][] copy2D(char[][] source)
-	{
-		if(source == null)
-			return null;
-		if(source.length < 1)
-			return new char[0][0];
-		char[][] target = new char[source.length][source[0].length];
-		for (int i = 0; i < source.length && i < target.length; i++) {
-			System.arraycopy(source[i], 0, target[i], 0, source[i].length);
-		}
-		return target;
-	}
-
-    /**
-     * Gets a copy of the 2D double array, source, that has the same data but shares no references with source.
-     * @param source a 2D double array
-     * @return a copy of source, or null if source is null
-     */
-	public static double[][] copy2D(double[][] source)
-	{
-		if(source == null)
-			return null;
-		if(source.length < 1)
-			return new double[0][0];
-		double[][] target = new double[source.length][source[0].length];
-		for (int i = 0; i < source.length && i < target.length; i++) {
-			System.arraycopy(source[i], 0, target[i], 0, source[i].length);
-		}
-		return target;
-	}
-
-    /**
-     * Gets a copy of the 2D int array, source, that has the same data but shares no references with source.
-     * @param source a 2D int array
-     * @return a copy of source, or null if source is null
-     */
-    public static int[][] copy2D(int[][] source)
-    {
-        if(source == null)
-            return null;
-        if(source.length < 1)
-            return new int[0][0];
-        int[][] target = new int[source.length][source[0].length];
-        for (int i = 0; i < source.length && i < target.length; i++) {
-            System.arraycopy(source[i], 0, target[i], 0, source[i].length);
-        }
-        return target;
-    }
-
-    /**
-     * Gets a copy of the 2D boolean array, source, that has the same data but shares no references with source.
-     * @param source a 2D boolean array
-     * @return a copy of source, or null if source is null
-     */
-    public static boolean[][] copy2D(boolean[][] source)
-    {
-        if(source == null)
-            return null;
-        if(source.length < 1)
-            return new boolean[0][0];
-        boolean[][] target = new boolean[source.length][source[0].length];
-        for (int i = 0; i < source.length && i < target.length; i++) {
-            System.arraycopy(source[i], 0, target[i], 0, source[i].length);
-        }
-        return target;
-    }
-
-    /**
-     * Inserts as much of source into target at the given x,y position as target can hold or source can supply.
-     * Modifies target in-place and also returns target for chaining.
-     * Used primarily to place a smaller array into a different position in a larger array, often freshly allocated.
-     * @param source a 2D char array that will be copied and inserted into target
-     * @param target a 2D char array that will be modified by receiving as much of source as it can hold
-     * @param x the x position in target to receive the items from the first cell in source
-     * @param y the y position in target to receive the items from the first cell in source
-     * @return a modified copy of target with source inserted into it at the given position
-     */
-    public static char[][] insert2D(char[][] source, char[][] target, int x, int y)
-    {
-        if(source == null || target == null)
-            return target;
-        if(source.length < 1 || source[0].length < 1)
-            return copy2D(target);
-        for (int i = 0; i < source.length && x + i < target.length; i++) {
-            System.arraycopy(source[i], 0, target[x + i], y, Math.min(source[i].length, target[x+i].length - y));
-        }
-        return target;
-    }
-    /**
-     * Inserts as much of source into target at the given x,y position as target can hold or source can supply.
-     * Modifies target in-place and also returns target for chaining.
-     * Used primarily to place a smaller array into a different position in a larger array, often freshly allocated.
-     * @param source a 2D double array that will be copied and inserted into target
-     * @param target a 2D double array that will be modified by receiving as much of source as it can hold
-     * @param x the x position in target to receive the items from the first cell in source
-     * @param y the y position in target to receive the items from the first cell in source
-     * @return a modified copy of target with source inserted into it at the given position
-     */
-    public static double[][] insert2D(double[][] source, double[][] target, int x, int y)
-    {
-        if(source == null || target == null)
-            return target;
-        if(source.length < 1 || source[0].length < 1)
-            return copy2D(target);
-        for (int i = 0; i < source.length && x + i < target.length; i++) {
-            System.arraycopy(source[i], 0, target[x + i], y, Math.min(source[i].length, target[x+i].length - y));
-        }
-        return target;
-    }
-    /**
-     * Inserts as much of source into target at the given x,y position as target can hold or source can supply.
-     * Modifies target in-place and also returns target for chaining.
-     * Used primarily to place a smaller array into a different position in a larger array, often freshly allocated.
-     * @param source a 2D int array that will be copied and inserted into target
-     * @param target a 2D int array that will be modified by receiving as much of source as it can hold
-     * @param x the x position in target to receive the items from the first cell in source
-     * @param y the y position in target to receive the items from the first cell in source
-     * @return a modified copy of target with source inserted into it at the given position
-     */
-    public static int[][] insert2D(int[][] source, int[][] target, int x, int y)
-    {
-        if(source == null || target == null)
-            return target;
-        if(source.length < 1 || source[0].length < 1)
-            return copy2D(target);
-        for (int i = 0; i < source.length && x + i < target.length; i++) {
-            System.arraycopy(source[i], 0, target[x + i], y, Math.min(source[i].length, target[x+i].length - y));
-        }
-        return target;
-    }
-    /**
-     * Inserts as much of source into target at the given x,y position as target can hold or source can supply.
-     * Modifies target in-place and also returns target for chaining.
-     * Used primarily to place a smaller array into a different position in a larger array, often freshly allocated.
-     * @param source a 2D boolean array that will be copied and inserted into target
-     * @param target a 2D boolean array that will be modified by receiving as much of source as it can hold
-     * @param x the x position in target to receive the items from the first cell in source
-     * @param y the y position in target to receive the items from the first cell in source
-     * @return a modified copy of target with source inserted into it at the given position
-     */
-    public static boolean[][] insert2D(boolean[][] source, boolean[][] target, int x, int y)
-    {
-        if(source == null || target == null)
-            return target;
-        if(source.length < 1 || source[0].length < 1)
-            return copy2D(target);
-        for (int i = 0; i < source.length && x + i < target.length; i++) {
-            System.arraycopy(source[i], 0, target[x + i], y, Math.min(source[i].length, target[x+i].length - y));
-        }
-        return target;
-    }
-
-    /**
-     * Creates a 2D array of the given width and height, filled with entirely with the value contents.
-     * @param contents the value to fill the array with
-     * @param width the desired width
-     * @param height the desired height
-     * @return a freshly allocated 2D array of the requested dimensions, filled entirely with contents
-     */
-    public static char[][] fill2D(char contents, int width, int height)
-    {
-        char[][] next = new char[width][height];
-        for (int x = 0; x < width; x++) {
-            Arrays.fill(next[x], contents);
-        }
-        return next;
-    }
-    /**
-     * Creates a 2D array of the given width and height, filled with entirely with the value contents.
-     * @param contents the value to fill the array with
-     * @param width the desired width
-     * @param height the desired height
-     * @return a freshly allocated 2D array of the requested dimensions, filled entirely with contents
-     */
-    public static double[][] fill2D(double contents, int width, int height)
-    {
-        double[][] next = new double[width][height];
-        for (int x = 0; x < width; x++) {
-            Arrays.fill(next[x], contents);
-        }
-        return next;
-    }
-    /**
-     * Creates a 2D array of the given width and height, filled with entirely with the value contents.
-     * @param contents the value to fill the array with
-     * @param width the desired width
-     * @param height the desired height
-     * @return a freshly allocated 2D array of the requested dimensions, filled entirely with contents
-     */
-    public static int[][] fill2D(int contents, int width, int height)
-    {
-        int[][] next = new int[width][height];
-        for (int x = 0; x < width; x++) {
-            Arrays.fill(next[x], contents);
-        }
-        return next;
-    }
-    /**
-     * Creates a 2D array of the given width and height, filled with entirely with the value contents.
-     * @param contents the value to fill the array with
-     * @param width the desired width
-     * @param height the desired height
-     * @return a freshly allocated 2D array of the requested dimensions, filled entirely with contents
-     */
-    public static boolean[][] fill2D(boolean contents, int width, int height)
-    {
-        boolean[][] next = new boolean[width][height];
-        if(contents) {
-            for (int x = 0; x < width; x++) {
-                Arrays.fill(next[x], true);
-            }
-        }
-        return next;
-    }
-
-    /**
-     * Rearranges an ArrayList to use the given ordering, returning a copy; random orderings can be produced with
-     * {@link squidpony.squidmath.RNG#randomOrdering(int)} or
-     * {@link squidpony.squidmath.RNG#randomOrdering(int, int[])}. These orderings will never repeat an earlier element,
-     * and the returned ArrayList may be shorter than the original if {@code ordering} isn't as long as {@code list}.
-     * Using a random ordering is like shuffling, but allows you to repeat the shuffle exactly on other collections of
-     * the same size. A reordering can also be inverted with {@link #invertOrdering(int[])} or
-     * {@link #invertOrdering(int[], int[])}, getting the change that will undo another ordering.
-     * @param list an ArrayList that you want a reordered version of; will not be modified.
-     * @param ordering an ordering, typically produced by one of RNG's randomOrdering methods.
-     * @param <T> any generic type
-     * @return a modified copy of {@code list} with its ordering changed to match {@code ordering}.
-     */
-    public static <T> ArrayList<T> reorder (ArrayList<T> list, int... ordering) {
-        int ol;
-        if (list == null || ordering == null || (ol = Math.min(list.size(), ordering.length)) == 0)
-            return list;
-        ArrayList<T> alt = new ArrayList<T>(ol);
-        for (int i = 0; i < ol; i++) {
-            alt.add(list.get((ordering[i] % ol + ol) % ol));
-        }
-        return alt;
-    }
-
 }

+ 1 - 1
squidlib-util/src/main/java/squidpony/panel/IColoredString.java

@@ -25,7 +25,7 @@ public interface IColoredString<T> extends Iterable<IColoredString.Bucket<T>> {
 	/**
 	 * A convenience alias for {@code append(c, null)}.
 	 * 
-	 * @param text
+	 * @param c
 	 */
 	void append(/* @Nullable */ char c);
 

+ 4 - 7
squidlib-util/src/main/java/squidpony/squidai/DijkstraMap.java

@@ -461,7 +461,7 @@ public class DijkstraMap implements Serializable {
 	 * normal cost to enter. The costs can be accessed later by using costMap
 	 * directly (which will have a valid value when this does not throw an
 	 * exception), or by calling setCost().
-	 * <p/>
+	 * 
 	 * This method allows you to specify an alternate wall char other than the
 	 * default character, '#' .
 	 *
@@ -491,7 +491,7 @@ public class DijkstraMap implements Serializable {
 	 * other impassable values should be given WALL as a value, however. The costs
 	 * can be accessed later by using costMap directly (which will have a valid
 	 * value when this does not throw an exception), or by calling setCost().
-	 * <p/>
+	 * 
 	 * This method should be slightly more efficient than the other initializeCost
 	 * methods.
 	 *
@@ -790,7 +790,7 @@ public class DijkstraMap implements Serializable {
 	 * considered more safe, and will make a pathfinder more likely to enter those
 	 * places if they were considered dangerous earlier (due to calling
 	 * deteriorate()).
-	 * <p/>
+	 * 
 	 * Typically, you call relax() with previous Coords a pathfinder stayed at that
 	 * should be safer now than they were at some previous point in time, and you
 	 * might do this when no one has been attacked in a while or when the AI is sure
@@ -811,7 +811,7 @@ public class DijkstraMap implements Serializable {
 	 * considered more safe, and will make a pathfinder more likely to enter those
 	 * places if they were considered dangerous earlier (due to calling
 	 * deteriorate()).
-	 * <p/>
+	 * 
 	 * Typically, you call relax() with previous Coords a pathfinder stayed at that
 	 * should be safer now than they were at some previous point in time, and you
 	 * might do this when no one has been attacked in a while or when the AI is sure
@@ -1836,9 +1836,6 @@ public class DijkstraMap implements Serializable {
 	 * @param maxPreferredRange
 	 *            the (inclusive) upper bound of the distance this unit will try to
 	 *            keep from a target
-	 * @param cache
-	 *            a FOVCache that has completed its calculations, and will be used
-	 *            for LOS work, may be null
 	 * @param impassable
 	 *            a Set of impassable Coord positions that may change (not constant
 	 *            like walls); can be null

+ 0 - 124
squidlib-util/src/main/java/squidpony/squidgrid/FOV.java

@@ -582,130 +582,6 @@ public class FOV implements Serializable {
         return lightMap;
     }
 
-    /**
-     * Adds multiple FOV maps together in the simplest way possible; does not check line-of-sight between FOV maps.
-     * Clamps the highest value for any single position at 1.0.
-     * @param maps an array or vararg of 2D double arrays, each usually returned by calculateFOV()
-     * @return the sum of all the 2D double arrays passed, using the dimensions of the first if they don't all match
-     */
-    public static double[][] addFOVs(double[][]... maps)
-    {
-        if(maps == null || maps.length == 0)
-            return new double[0][0];
-        double[][] map = GwtCompatibility.copy2D(maps[0]);
-        for(int i = 1; i < maps.length; i++)
-        {
-            for (int x = 0; x < map.length && x < maps[i].length; x++) {
-                for (int y = 0; y < map[x].length && y < maps[i][x].length; y++) {
-                    map[x][y] += maps[i][x][y];
-                }
-            }
-        }
-        for (int x = 0; x < map.length; x++) {
-            for (int y = 0; y < map[x].length; y++) {
-                if(map[x][y] > 1.0) map[x][y] = 1.0;
-            }
-        }
-        return map;
-    }
-
-    /**
-     * Adds multiple FOV maps together in the simplest way possible; does not check line-of-sight between FOV maps.
-     * Clamps the highest value for any single position at 1.0.
-     * @param maps an Iterable of 2D double arrays (most collections implement Iterable),
-     *             each usually returned by calculateFOV()
-     * @return the sum of all the 2D double arrays passed, using the dimensions of the first if they don't all match
-     */
-    public static double[][] addFOVs(Iterable<double[][]> maps)
-    {
-        if(maps == null)
-            return new double[0][0];
-        Iterator<double[][]> it = maps.iterator();
-        if(!it.hasNext())
-            return new double[0][0];
-        double[][] map = GwtCompatibility.copy2D(it.next()), t;
-        while (it.hasNext())
-        {
-            t = it.next();
-            for (int x = 0; x < map.length && x < t.length; x++) {
-                for (int y = 0; y < map[x].length && y < t[x].length; y++) {
-                    map[x][y] += t[x][y];
-                }
-            }
-        }
-        for (int x = 0; x < map.length; x++) {
-            for (int y = 0; y < map[x].length; y++) {
-                if(map[x][y] > 1.0) map[x][y] = 1.0;
-            }
-        }
-        return map;
-    }
-
-    /**
-     * Adds together multiple FOV maps, but only adds to a position if it is visible in the given LOS map. Useful if
-     * you want distant lighting to be visible only if the player has line-of-sight to a lit cell. Typically the LOS map
-     * is calculated by calculateLOSMap(), using the same resistance map used to calculate the FOV maps.
-     * Clamps the highest value for any single position at 1.0.
-     * @param losMap an LOS map such as one generated by calculateLOSMap()
-     * @param maps an array or vararg of 2D double arrays, each usually returned by calculateFOV()
-     * @return the sum of all the 2D double arrays in maps where a cell was visible in losMap
-     */
-    public static double[][] mixVisibleFOVs(double[][] losMap, double[][]... maps)
-    {
-        if(losMap == null || losMap.length == 0)
-            return addFOVs(maps);
-        double[][] map = new double[losMap.length][losMap[0].length];
-        if(maps == null || maps.length == 0)
-            return map;
-        for(int i = 0; i < maps.length; i++)
-        {
-            for (int x = 0; x < losMap.length && x < map.length && x < maps[i].length; x++) {
-                for (int y = 0; y < losMap[x].length && y < map[x].length && y < maps[i][x].length; y++) {
-                    if(losMap[x][y] > 0.0001) {
-                        map[x][y] += maps[i][x][y];
-                        if(map[x][y] > 1.0) map[x][y] = 1.0;
-                    }
-                }
-            }
-        }
-        return map;
-    }
-
-    /**
-     * Adds together multiple FOV maps, but only adds to a position if it is visible in the given LOS map. Useful if
-     * you want distant lighting to be visible only if the player has line-of-sight to a lit cell. Typically the LOS map
-     * is calculated by calculateLOSMap(), using the same resistance map used to calculate the FOV maps.
-     * Clamps the highest value for any single position at 1.0.
-     * @param losMap an LOS map such as one generated by calculateLOSMap()
-     * @param maps an Iterable of 2D double arrays, each usually returned by calculateFOV()
-     * @return the sum of all the 2D double arrays in maps where a cell was visible in losMap
-     */
-    public static double[][] mixVisibleFOVs(double[][] losMap, Iterable<double[][]> maps)
-    {
-        if(losMap == null || losMap.length == 0)
-            return addFOVs(maps);
-        double[][] map = new double[losMap.length][losMap[0].length], t;
-        if(maps == null)
-            return map;
-        Iterator<double[][]> it = maps.iterator();
-        if(!it.hasNext())
-            return map;
-
-        while (it.hasNext())
-        {
-            t = it.next();
-            for (int x = 0; x < losMap.length && x < map.length && x < t.length; x++) {
-                for (int y = 0; y < losMap[x].length && y < map[x].length && y < t[x].length; y++) {
-                    if (losMap[x][y] > 0.0001) {
-                        map[x][y] += t[x][y];
-                        if(map[x][y] > 1.0) map[x][y] = 1.0;
-                    }
-                }
-            }
-        }
-        return map;
-    }
-
     /**
      * Calculates what cells are visible from (startX,startY) using the given resistanceMap; this can be given to
      * mixVisibleFOVs() to limit extra light sources to those visible from the starting point. Just like calling

+ 1 - 1
squidlib-util/src/main/java/squidpony/squidgrid/LOS.java

@@ -19,7 +19,7 @@ import squidpony.squidmath.OrderedSet;
  * are the default (they can also be specified by passing {@link #BRESENHAM} to
  * the constructor). For more specialized usage, there are other kinds of LOS in
  * this class, like lines that make no diagonal moves between cells (using
- * {@link #ORTHO}, or lines that check a wide path (but these use different
+ * {@code ORTHO}, or lines that check a wide path (but these use different
  * methods, like {@link #thickReachable(Radius)}). <br>
  * Performance-wise, all of these methods are rather fast and about the same
  * speed. {@link #RAY} is a tiny fraction faster than {@link #BRESENHAM} but

+ 0 - 812
squidlib-util/src/main/java/squidpony/squidgrid/mapping/DungeonUtility.java

@@ -296,57 +296,6 @@ public class DungeonUtility {
 		return portion;
 	}
 
-	/**
-	 * Takes a dungeon map with either '#' as the only wall character or the unicode
-	 * box drawing characters used by hashesToLines(), and returns a new char[][]
-	 * dungeon map with two characters per cell, mostly filling the spaces next to
-	 * non-walls with space characters, and only doing anything different if a
-	 * box-drawing character would continue into an adjacent cell, or if a '#' wall
-	 * needs another '#' wall next to it. The recommended approach is to keep both
-	 * the original non-double-width map and the newly-returned double-width map,
-	 * since the single-width maps can be used more easily for pathfinding. If you
-	 * need to undo this function, call unDoubleWidth().
-	 *
-	 * @param map
-	 *            a char[][] that uses either '#' or box-drawing characters for
-	 *            walls, but one per cell
-	 * @return a widened copy of map that uses two characters for every cell,
-	 *         connecting box-drawing chars correctly
-	 */
-	public static char[][] doubleWidth(char[][] map) {
-		int width = map.length;
-		int height = map[0].length;
-		char[][] paired = new char[width * 2][height];
-		for (int y = 0; y < height; y++) {
-			for (int x = 0, px = 0; x < width; x++, px += 2) {
-				paired[px][y] = map[x][y];
-				switch (paired[px][y]) {
-				// case '┼ ├ ┤ ┴ ┬ ┌ ┐ └ ┘ │ ─'
-				case '┼':
-				case '├':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '└':
-				case '─':
-					paired[px + 1][y] = '─';
-					break;
-				case '#':
-					paired[px + 1][y] = '#';
-					break;
-
-				default:
-					paired[px + 1][y] = ' ';
-					break;
-				/*
-				 * case '.': case '┤': case '┐': case '┘': case '│':
-				 */
-				}
-			}
-		}
-		return paired;
-	}
-
 	/**
 	 * Takes a dungeon map that uses two characters per cell, and condenses it to
 	 * use only the left (lower index) character in each cell. This should
@@ -372,767 +321,6 @@ public class DungeonUtility {
 		return unpaired;
 	}
 
-	/**
-	 * Produces an int[][] that can be used with any palette of your choice for
-	 * methods in SquidPanel or for your own rendering method. 1 is used as a
-	 * default and for tiles with nothing in them; if the background is black, then
-	 * white would make sense as this default. Other indices used are 2 for walls
-	 * (this doesn't care if the walls are hashes or lines), 3 for floors (usually
-	 * '.'), 4 for doors ('+' and '/' in the map), 5 for water, 6 for traps, and 20
-	 * for grass.
-	 *
-	 * @param map
-	 *            a char[][] containing foreground characters that you want
-	 *            foreground palette indices for
-	 * @return a 2D array of ints that can be used as indices into a palette;
-	 *         palettes are available in related modules
-	 */
-	public static int[][] generatePaletteIndices(char[][] map) {
-
-		int width = map.length;
-		int height = map[0].length;
-		int[][] portion = new int[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 2;
-					break;
-				case '.':
-				case ':':
-					portion[i][j] = 3;
-					break;
-				case '+':
-				case '/':
-					portion[i][j] = 4;
-					break;
-				case ',':
-				case '~':
-					portion[i][j] = 5;
-					break;
-				case '"':
-					portion[i][j] = 20;
-					break;
-				case '^':
-					portion[i][j] = 6;
-					break;
-				default:
-					portion[i][j] = 1;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Produces an int[][] that can be used with any palette of your choice for
-	 * methods in SquidPanel or for your own rendering method. 1 is used as a
-	 * default and for tiles with nothing in them; if the background is black, then
-	 * white would make sense as this default. Other indices used are 2 for walls
-	 * (this doesn't care if the walls are hashes or lines), 3 for floors (usually
-	 * '.'), 4 for doors ('+' and '/' in the map), 5 for water, 6 for traps, and 20
-	 * for grass.
-	 *
-	 * @param map
-	 *            a char[][] containing foreground characters that you want
-	 *            foreground palette indices for
-	 * @return a 2D array of ints that can be used as indices into a palette;
-	 *         palettes are available in related modules
-	 */
-	public static int[][] generatePaletteIndices(char[][] map, char deepChar, int deepIndex, char shallowChar,
-			int shallowIndex) {
-
-		int width = map.length;
-		int height = map[0].length;
-		int[][] portion = new int[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 2;
-					break;
-				case '.':
-				case ':':
-					portion[i][j] = 3;
-					break;
-				case '+':
-				case '/':
-					portion[i][j] = 4;
-					break;
-				case ',':
-				case '~':
-					portion[i][j] = 5;
-					break;
-				case '"':
-					portion[i][j] = 20;
-					break;
-				case '^':
-					portion[i][j] = 6;
-					break;
-				default:
-					if (map[i][j] == deepChar)
-						portion[i][j] = deepIndex;
-					else if (map[i][j] == shallowChar)
-						portion[i][j] = shallowIndex;
-					else
-						portion[i][j] = 1;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Produces an int[][] that can be used with any palette of your choice for
-	 * methods in SquidPanel or for your own rendering method, but meant for the
-	 * background palette. This will produce 0 for most characters, but deep water
-	 * (represented by '~') will produce 24 (in the default palette, this is dark
-	 * blue-green), shallow water (represented by ',') will produce 23 (medium
-	 * blue-green), and grass (represented by '"') will produce 21 (dark green). If
-	 * you use SquidLayers, you can cause the lightness of water and grass to vary
-	 * as if currents or wind are moving their surface using getLightnessModifiers()
-	 * and a frame count argument.
-	 *
-	 * @param map
-	 *            a char[][] containing foreground characters that you want
-	 *            background palette indices for
-	 * @return a 2D array of ints that can be used as indices into a palette;
-	 *         palettes are available in related modules
-	 */
-	public static int[][] generateBGPaletteIndices(char[][] map) {
-
-		int width = map.length;
-		int height = map[0].length;
-		int[][] portion = new int[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 0;
-					break;
-				case '.':
-					portion[i][j] = 0;
-					break;
-				case ':':
-					portion[i][j] = 35;
-					break;
-				case '+':
-				case '/':
-					portion[i][j] = 0;
-					break;
-				case ',':
-					portion[i][j] = 23;
-					break;
-				case '~':
-					portion[i][j] = 24;
-					break;
-				case '"':
-					portion[i][j] = 21;
-					break;
-				case '^':
-					portion[i][j] = 0;
-					break;
-				default:
-					portion[i][j] = 0;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Produces an int[][] that can be used with any palette of your choice for
-	 * methods in SquidPanel or for your own rendering method, but meant for the
-	 * background palette. This will produce 0 for most characters, but deep water
-	 * (represented by '~') will produce 24 (in the default palette, this is dark
-	 * blue-green), shallow water (represented by ',') will produce 23 (medium
-	 * blue-green), and grass (represented by '"') will produce 21 (dark green). If
-	 * you use SquidLayers, you can cause the lightness of water and grass to vary
-	 * as if currents or wind are moving their surface using getLightnessModifiers()
-	 * and a frame count argument.
-	 *
-	 * @param map
-	 *            a char[][] containing foreground characters that you want
-	 *            background palette indices for
-	 * @return a 2D array of ints that can be used as indices into a palette;
-	 *         palettes are available in related modules
-	 */
-	public static int[][] generateBGPaletteIndices(char[][] map, char deepChar, int deepIndex, char shallowChar,
-			int shallowIndex) {
-
-		int width = map.length;
-		int height = map[0].length;
-		int[][] portion = new int[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 0;
-					break;
-				case '.':
-					portion[i][j] = 0;
-					break;
-				case ':':
-					portion[i][j] = 35;
-					break;
-				case '+':
-				case '/':
-					portion[i][j] = 0;
-					break;
-				case ',':
-					portion[i][j] = 23;
-					break;
-				case '~':
-					portion[i][j] = 24;
-					break;
-				case '"':
-					portion[i][j] = 21;
-					break;
-				case '^':
-					portion[i][j] = 0;
-					break;
-				default:
-					if (map[i][j] == deepChar)
-						portion[i][j] = deepIndex;
-					else if (map[i][j] == shallowChar)
-						portion[i][j] = shallowIndex;
-					else
-						portion[i][j] = 0;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Produces an int[][] that can be used with SquidLayers to alter the background
-	 * colors.
-	 *
-	 * @param map
-	 *            a char[][] that you want to be find background lightness modifiers
-	 *            for
-	 * @return a 2D array of lightness values from -255 to 255 but usually close to
-	 *         0; can be passed to SquidLayers
-	 */
-	public static int[][] generateLightnessModifiers(char[][] map) {
-		int width = map.length;
-		int height = map[0].length;
-		int[][] portion = new int[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 30;
-					break;
-				case '.':
-					portion[i][j] = 0;
-					break;
-				case ':':
-					portion[i][j] = -15;
-					break;
-				case '+':
-				case '/':
-					portion[i][j] = -10;
-					break;
-				case ',':
-					portion[i][j] = (int) (70 * (PerlinNoise.noise(i / 4.0, j / 4.0) / 2.5 - 0.45));
-					break;
-				case '~':
-					portion[i][j] = (int) (100 * (PerlinNoise.noise(i / 4.0, j / 4.0) / 2.5 - 0.65));
-					break;
-				case '"':
-					portion[i][j] = (int) (75 * (PerlinNoise.noise(i / 4.0, j / 4.0) / 4.0 - 1.5));
-					break;
-				case '^':
-					portion[i][j] = 40;
-					break;
-				default:
-					portion[i][j] = 0;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Produces an int[][] that can be used with SquidLayers to alter the background
-	 * colors, accepting a parameter for animation frame if rippling water and
-	 * waving grass using Perlin Noise are desired.
-	 *
-	 * @param map
-	 *            a char[][] that you want to be find background lightness modifiers
-	 *            for
-	 * @param frame
-	 *            a counter that typically should increase by between 10.0 and 20.0
-	 *            each second; higher numbers make water and grass move more
-	 * @return a 2D array of lightness values from -255 to 255 but usually close to
-	 *         0; can be passed to SquidLayers
-	 */
-	public static int[][] generateLightnessModifiers(char[][] map, double frame) {
-		int width = map.length;
-		int height = map[0].length;
-		int[][] portion = new int[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 30;
-					break;
-				case '.':
-					portion[i][j] = 0;
-					break;
-				case ':':
-					portion[i][j] = -15;
-					break;
-				case '+':
-				case '/':
-					portion[i][j] = -10;
-					break;
-				case ',':
-					portion[i][j] = (int) (70 * (PerlinNoise.noise(i / 4.0, j / 4.0, frame / 25.0) / 2.5 - 0.45));
-					break;
-				case '~':
-					portion[i][j] = (int) (100 * (PerlinNoise.noise(i / 4.0, j / 4.0, frame / 25.0) / 2.5 - 0.65));
-					break;
-				case '"':
-					portion[i][j] = (int) (75 * (PerlinNoise.noise(i / 4.0, j / 4.0, frame / 35.0) / 4.0 - 1.5));
-					break;
-				case '^':
-					portion[i][j] = 40;
-					break;
-				default:
-					portion[i][j] = 0;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Produces an int[][] that can be used with SquidLayers to alter the background
-	 * colors, accepting a parameter for animation frame if rippling water and
-	 * waving grass using Perlin Noise are desired. Also allows additional chars to
-	 * be treated like deep and shallow water regarding the ripple animation.
-	 *
-	 * @param map
-	 *            a char[][] that you want to be find background lightness modifiers
-	 *            for
-	 * @param frame
-	 *            a counter that typically should increase by between 10.0 and 20.0
-	 *            each second; higher numbers make water and grass move more
-	 * @param deepLiquid
-	 *            a char that will be treated like deep water when animating ripples
-	 * @param shallowLiquid
-	 *            a char that will be treated like shallow water when animating
-	 *            ripples
-	 * @return a 2D array of lightness values from -255 to 255 but usually close to
-	 *         0; can be passed to SquidLayers
-	 */
-	public static int[][] generateLightnessModifiers(char[][] map, double frame, char deepLiquid, char shallowLiquid) {
-		int width = map.length;
-		int height = map[0].length;
-		int[][] portion = new int[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 30;
-					break;
-				case '.':
-					portion[i][j] = 0;
-					break;
-				case ':':
-					portion[i][j] = -15;
-					break;
-				case '+':
-				case '/':
-					portion[i][j] = -10;
-					break;
-				case ',':
-					portion[i][j] = (int) (70 * (PerlinNoise.noise(i / 4.0, j / 4.0, frame / 25.0) / 2.5 - 0.45));
-					break;
-				case '~':
-					portion[i][j] = (int) (100 * (PerlinNoise.noise(i / 4.0, j / 4.0, frame / 25.0) / 2.5 - 0.65));
-					break;
-				case '"':
-					portion[i][j] = (int) (75 * (PerlinNoise.noise(i / 4.0, j / 4.0, frame / 35.0) / 4.0 - 1.5));
-					break;
-				case '^':
-					portion[i][j] = 40;
-					break;
-				default:
-					if (map[i][j] == deepLiquid)
-						portion[i][j] = (int) (180 * (PerlinNoise.noise(i / 5.0, j / 5.0, frame / 21.0) / 2.5 - 0.7));
-					else if (map[i][j] == shallowLiquid)
-						portion[i][j] = (int) (110 * (PerlinNoise.noise(i / 4.0, j / 4.0, frame / 30.0) / 2.5 - 0.45));
-					else
-						portion[i][j] = 0;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Given a char[][] for the map, produces a double[][] that can be used with
-	 * FOV.calculateFOV(). It expects any doors to be represented by '+' if closed
-	 * or '/' if open (which can be caused by calling DungeonUtility.closeDoors() ),
-	 * any walls to be '#' or line drawing characters, and it doesn't care what
-	 * other chars are used (only doors, including open ones, and walls obscure
-	 * light and thus have a resistance by default).
-	 *
-	 * @param map
-	 *            a dungeon, width by height, with any closed doors as '+' and open
-	 *            doors as '/' as per closeDoors()
-	 * @return a resistance map suitable for use with the FOV class
-	 */
-	public static double[][] generateResistances(char[][] map) {
-		int width = map.length;
-		int height = map[0].length;
-		double[][] portion = new double[width][height];
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				switch (map[i][j]) {
-				case '\1':
-				case '├':
-				case '┤':
-				case '┴':
-				case '┬':
-				case '┌':
-				case '┐':
-				case '└':
-				case '┘':
-				case '│':
-				case '─':
-				case '┼':
-				case '#':
-					portion[i][j] = 1.0;
-					break;
-				case '/':
-				case '"':
-					portion[i][j] = 0.15;
-					break;
-				case '+':
-					portion[i][j] = 0.95;
-					break;
-				case '.':
-				case ',':
-				case '~':
-				case '^':
-				default:
-					portion[i][j] = 0.0;
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Given a char[][] for the map, a Map of Character keys to Double values that
-	 * will be used to determine costs, and a double value for unhandled characters,
-	 * produces a double[][] that can be used as a costMap by DijkstraMap. It
-	 * expects any doors to be represented by '+' if closed or '/' if open (which
-	 * can be caused by calling DungeonUtility.closeDoors() ) and any walls to be
-	 * '#' or line drawing characters. In the parameter costs, there does not need
-	 * to be an entry for '#' or any box drawing characters, but if one is present
-	 * for '#' it will apply that cost to both '#' and all box drawing characters,
-	 * and if one is not present it will default to a very high number. For any
-	 * other entry in costs, a char in the 2D char array that matches the key will
-	 * correspond (at the same x,y position in the returned 2D double array) to that
-	 * key's value in costs. If a char is used in the map but does not have a
-	 * corresponding key in costs, it will be given the value of the parameter
-	 * defaultValue.
-	 * <p/>
-	 * The values in costs are multipliers, so should not be negative, should only
-	 * be 0.0 in cases where you want infinite movement across all adjacent squares
-	 * of that kind, should be higher than 1.0 for difficult terrain (2.0 and 3.0
-	 * are reasonable), should be between 0.0 and 1.0 for easy terrain, and should
-	 * be 1.0 for normal terrain. If a cell should not be possible to enter for this
-	 * character, 999.0 should be a reasonable value for a cost.
-	 * <p/>
-	 * An example use for this would be to make a creature unable to enter any
-	 * non-water cell (like a fish), unable to enter doorways (like some
-	 * mythological versions of vampires), or to make a wheeled vehicle take more
-	 * time to move across rubble or rough terrain.
-	 * <p/>
-	 * A potentially common case that needs to be addressed is NPC movement onto
-	 * staircases in games that have them; some games may find it desirable for NPCs
-	 * to block staircases and others may not, but in either case you should give
-	 * both '&gt;' and '&lt;', the standard characters for staircases, the same
-	 * value in costs.
-	 *
-	 * @param map
-	 *            a dungeon, width by height, with any closed doors as '+' and open
-	 *            doors as '/' as per closeDoors() .
-	 * @param costs
-	 *            a Map of Character keys representing possible elements in map, and
-	 *            Double values for their cost.
-	 * @param defaultValue
-	 *            a double that will be used as the cost for any characters that
-	 *            don't have a key in costs.
-	 * @return a cost map suitable for use with DijkstraMap
-	 */
-	public static double[][] generateCostMap(char[][] map, Map<Character, Double> costs, double defaultValue) {
-		int width = map.length;
-		int height = map[0].length;
-		double[][] portion = new double[width][height];
-		char current;
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				current = map[i][j];
-				if (costs.containsKey(current)) {
-					portion[i][j] = costs.get(current);
-				} else {
-					switch (current) {
-					case '\1':
-					case '├':
-					case '┤':
-					case '┴':
-					case '┬':
-					case '┌':
-					case '┐':
-					case '└':
-					case '┘':
-					case '│':
-					case '─':
-					case '┼':
-					case '#':
-						portion[i][j] = (costs.containsKey('#')) ? costs.get('#') : squidpony.squidai.DijkstraMap.WALL;
-						break;
-					default:
-						portion[i][j] = defaultValue;
-					}
-				}
-			}
-		}
-		return portion;
-	}
-
-	/**
-	 * Given a char[][] for the map, a Map of Character keys to Double values that
-	 * will be used to determine costs, and a double value for unhandled characters,
-	 * produces a double[][] that can be used as a map by AStarSearch. It expects
-	 * any doors to be represented by '+' if closed or '/' if open (which can be
-	 * caused by calling DungeonUtility.closeDoors() ) and any walls to be '#' or
-	 * line drawing characters. In the parameter costs, there does not need to be an
-	 * entry for '#' or any box drawing characters, but if one is present for '#' it
-	 * will apply that cost to both '#' and all box drawing characters, and if one
-	 * is not present it will default to a negative number, meaning it is impassable
-	 * for AStarSearch. For any other entry in costs, a char in the 2D char array
-	 * that matches the key will correspond (at the same x,y position in the
-	 * returned 2D double array) to that key's value in costs. If a char is used in
-	 * the map but does not have a corresponding key in costs, it will be given the
-	 * value of the parameter defaultValue, which is typically 0 unless a creature
-	 * is limited to only moving in some terrain.
-	 * <p/>
-	 * The values in costs are different from those expected for DijkstraMap;
-	 * negative numbers are impassable, 0 is the cost for a normal walkable tile,
-	 * and higher numbers are harder to enter.
-	 * <p/>
-	 * An example use for this would be to make a creature unable to enter any
-	 * non-water cell (like a fish), unable to enter doorways (like some
-	 * mythological versions of vampires), or to make a wheeled vehicle take more
-	 * time to move across rubble or rough terrain.
-	 * <p/>
-	 * A potentially common case that needs to be addressed is NPC movement onto
-	 * staircases in games that have them; some games may find it desirable for NPCs
-	 * to block staircases and others may not, but in either case you should give
-	 * both '&gt;' and '&lt;', the standard characters for staircases, the same
-	 * value in costs.
-	 *
-	 * @param map
-	 *            a dungeon, width by height, with any closed doors as '+' and open
-	 *            doors as '/' as per closeDoors() .
-	 * @param costs
-	 *            a Map of Character keys representing possible elements in map, and
-	 *            Double values for their cost.
-	 * @param defaultValue
-	 *            a double that will be used as the cost for any characters that
-	 *            don't have a key in costs.
-	 * @return a cost map suitable for use with AStarSearch
-	 */
-	public static double[][] generateAStarCostMap(char[][] map, Map<Character, Double> costs, double defaultValue) {
-		int width = map.length;
-		int height = map[0].length;
-		double[][] portion = new double[width][height];
-		char current;
-		for (int i = 0; i < width; i++) {
-			for (int j = 0; j < height; j++) {
-				current = map[i][j];
-				if (costs.containsKey(current)) {
-					portion[i][j] = costs.get(current);
-				} else {
-					switch (current) {
-					case '\1':
-					case '├':
-					case '┤':
-					case '┴':
-					case '┬':
-					case '┌':
-					case '┐':
-					case '└':
-					case '┘':
-					case '│':
-					case '─':
-					case '┼':
-					case '#':
-						portion[i][j] = (costs.containsKey('#')) ? costs.get('#') : squidpony.squidai.DijkstraMap.WALL;
-						break;
-					default:
-						portion[i][j] = defaultValue;
-					}
-				}
-			}
-		}
-		return portion;
-	}
-
-	public static double[][] translateAStarToDijkstra(double[][] astar) {
-		if (astar == null)
-			return null;
-		if (astar.length <= 0 || astar[0].length <= 0)
-			return new double[0][0];
-		double[][] dijkstra = new double[astar.length][astar[0].length];
-		for (int x = 0; x < astar.length; x++) {
-			for (int y = 0; y < astar[x].length; y++) {
-				if (astar[x][y] < 0)
-					dijkstra[x][y] = DijkstraMap.WALL;
-				else
-					dijkstra[x][y] = DijkstraMap.FLOOR;
-			}
-		}
-		return dijkstra;
-	}
-
-	public static double[][] translateDijkstraToAStar(double[][] dijkstra) {
-		if (dijkstra == null)
-			return null;
-		if (dijkstra.length <= 0 || dijkstra[0].length <= 0)
-			return new double[0][0];
-		double[][] astar = new double[dijkstra.length][dijkstra[0].length];
-		for (int x = 0; x < dijkstra.length; x++) {
-			for (int y = 0; y < dijkstra[x].length; y++) {
-				if (dijkstra[x][y] > DijkstraMap.FLOOR)
-					astar[x][y] = -1;
-				else
-					astar[x][y] = 1;
-			}
-		}
-		return astar;
-	}
-
-	/**
-	 * @param rng
-	 * @param map
-	 * @param acceptable
-	 * @param frustration
-	 *            The number of trials that this method can do. Usually 16 or 32.
-	 * @return A random cell in {@code map} whose symbol is in {@code acceptable}.
-	 *         Or {@code null} if not found.
-	 */
-	public static /* @Nullable */Coord getRandomCell(RNG rng, char[][] map, Set<Character> acceptable,
-			int frustration) {
-		if (frustration < 0)
-			throw new IllegalStateException("Frustration should not be negative");
-		final int width = map.length;
-		final int height = width == 0 ? 0 : map[0].length;
-		if (width == 0 || height == 0)
-			throw new IllegalStateException("Map must be non-empty to get a cell from it");
-		int i = 0;
-		while (i < frustration) {
-			final int x = rng.nextInt(width);
-			final int y = rng.nextInt(height);
-			if (acceptable.contains(map[x][y]))
-				return Coord.get(x, y);
-			i++;
-		}
-		return null;
-	}
-
 	/**
 	 * @param level
 	 *            dungeon/map level as 2D char array. x,y indexed

+ 1 - 4
squidlib-util/src/main/java/squidpony/squidmath/IRNG.java

@@ -181,7 +181,6 @@ public interface IRNG {
 	 *            an array of T; <b>will</b> be modified
 	 * @param <T>
 	 *            can be any non-primitive type.
-	 * @return elements after shuffling it in-place
 	 */
 	public <T> void shuffleInPlace(T[] elements);
 
@@ -228,9 +227,7 @@ public interface IRNG {
 	public <T> ArrayList<T> shuffle(Collection<T> elements, /* @Nullable */ ArrayList<T> buf);
 
 	/**
-	 * The state of {@code this}. May be {@code this} itself, maybe not.
-	 * 
-	 * @param acc
+	 * @return The state of {@code this}. May be {@code this} itself, maybe not.
 	 */
 	public Serializable toSerializable();
 }

+ 0 - 4
squidlib-util/src/main/java/squidpony/squidmath/IntDoubleOrderedMap.java

@@ -83,10 +83,6 @@ public class IntDoubleOrderedMap implements SortedMap<Integer, Double>, java.io.
      * The index of the last entry in iteration order. It is valid iff {@link #size} is nonzero; otherwise, it contains -1.
      */
     protected int last = -1;
-    /**
-     * For each entry, the next and the previous entry in iteration order, stored as <code>((prev & 0xFFFFFFFFL) << 32) | (next & 0xFFFFFFFFL)</code>. The first entry contains predecessor -1, and the
-     * last entry contains successor -1.
-     */
     protected long[] link;
     /**
      * The current table size.

+ 15 - 42
squidlib-util/src/main/java/squidpony/squidmath/RNG.java

@@ -1,22 +1,32 @@
 package squidpony.squidmath;
 
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Random;
+
 import squidpony.GwtCompatibility;
 import squidpony.annotation.GwtIncompatible;
 
-import java.io.Serializable;
-import java.util.*;
-
 /**
  * A wrapper class for working with random number generators in a more friendly
  * way.
  *
  * Includes methods for getting values between two numbers and for getting
  * random elements from a collection or array.
+ * 
+ * @deprecated Use {@link IRNG} instead
  *
  * @author Eben Howard - http://squidpony.com - howard@squidpony.com
  * @author Tommy Ettinger
  * @author smelC
  */
+@Deprecated
 public class RNG implements Serializable {
 
 	protected static final double DOUBLE_UNIT = 1.0 / (1L << 53);
@@ -546,15 +556,14 @@ public class RNG implements Serializable {
 
 	/**
 	 * Shuffles an array in place using the Fisher-Yates algorithm. If you don't
-	 * want the array modified, use {@link #shuffle(Object[], Object[])}. Unlike
-	 * {@link #shuffle(Object[])}, this is GWT-compatible. <br>
+	 * want the array modified, use {@code shuffle(Object[], Object[])}. Unlike
+	 * {@code shuffle(Object[])}, this is GWT-compatible. <br>
 	 * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
 	 * 
 	 * @param elements
 	 *            an array of T; <b>will</b> be modified
 	 * @param <T>
 	 *            can be any non-primitive type.
-	 * @return elements after shuffling it in-place
 	 */
 	public <T> void shuffleInPlace(T[] elements) {
 		for (int i = elements.length - 1; i > 0; i--) {
@@ -576,42 +585,6 @@ public class RNG implements Serializable {
 		}
 	}
 
-	/**
-	 * Shuffle an array using the "inside-out" Fisher-Yates algorithm. DO NOT
-	 * give the same array for both elements and dest, since the prior contents
-	 * of dest are rearranged before elements is used, and if they refer to the
-	 * same array, then you can end up with bizarre bugs where one
-	 * previously-unique item shows up dozens of times. If possible, create a
-	 * new array with the same length as elements and pass it in as dest; the
-	 * returned value can be assigned to whatever you want and will have the
-	 * same items as the newly-formed array. <br>
-	 * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_.22inside-
-	 * out.22_algorithm
-	 * 
-	 * @param elements
-	 *            an array of T; will not be modified
-	 * @param <T>
-	 *            can be any non-primitive type.
-	 * @param dest
-	 *            Where to put the shuffle. If it does not have the same length
-	 *            as {@code elements}, this will use the randomPortion method of
-	 *            this class to fill the smaller dest. MUST NOT be the same
-	 *            array as elements!
-	 * @return {@code dest} after modifications
-	 */
-	/* This method has this prototype to be compatible with GWT. */
-	public <T> T[] shuffle(T[] elements, T[] dest) {
-		if (dest.length != elements.length)
-			return randomPortion(elements, dest);
-		for (int i = 0; i < elements.length; i++) {
-			int r = nextInt(i + 1);
-			if (r != i)
-				dest[i] = dest[r];
-			dest[r] = elements[i];
-		}
-		return dest;
-	}
-
 	/**
 	 * Shuffles a {@link Collection} of T using the Fisher-Yates algorithm and
 	 * returns an ArrayList of T.

+ 43 - 50
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/AbstractSquidScreen.java

@@ -16,26 +16,25 @@ import squidpony.IColorCenter;
  * 
  * <p>
  * By implementing {@link #getNext()}, you specify how to switch between screens
- * (for example: splash screen -> (main menu screen <-> game screen)). To build
- * your {@link SquidPanel}, you should use the protected methods that this class
- * provides. In this way, you won't have to worry about the screen size and
- * resizing.
+ * (for example: splash screen -&gt; (main menu screen &lt;-&gt; game screen)).
+ * To build your {@link SquidPanel}, you should use the protected methods that
+ * this class provides. In this way, you won't have to worry about the screen
+ * size and resizing.
  * </p>
  * 
  * <p>
  * Moving from a screen to another is either triggered by libgdx (when it calls
  * {@link #resize(int, int)} and {@link #dispose()}) or by you (you can call
  * {@link #dispose()} directly). In both cases, it'll make
- * {@link SquidApplicationAdapter}'s
- * {@link com.badlogic.gdx.ApplicationAdapter#render()} method call
- * {@link #getNext()}, hereby triggering screen change.
+ * {@link com.badlogic.gdx.ApplicationAdapter#render()} call {@link #getNext()},
+ * hereby triggering screen change.
  * </p>
  * 
  * <p>
  * There really is now way around this class being abstract. Very often, the
  * result of {@link #getNext()} cannot be precomputed. For example after a game
- * screen, either you'll go to the win screen or the lose screen. And the
- * latter cannot be precomputed when building the game screen :-(
+ * screen, either you'll go to the win screen or the lose screen. And the latter
+ * cannot be precomputed when building the game screen :-(
  * </p>
  * 
  * @author smelC
@@ -47,8 +46,8 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 
 	/**
 	 * The current size manager. It is always up-to-date w.r.t. to the actual
-	 * screen's size, except when a call to {@link #resize(int, int)} has been
-	 * done by libgdx, and {@link #getNext()} wasn't called yet.
+	 * screen's size, except when a call to {@link #resize(int, int)} has been done
+	 * by libgdx, and {@link #getNext()} wasn't called yet.
 	 */
 	protected ScreenSizeManager sizeManager;
 
@@ -56,9 +55,9 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 	protected final IPanelBuilder ipb;
 
 	/**
-	 * It is up to subclassers to initialize this field. Beware that is disposed
-	 * if non-null in {@link #dispose()}. Usually it is assigned at construction
-	 * time or in {@link #render(float)}.
+	 * It is up to subclassers to initialize this field. Beware that is disposed if
+	 * non-null in {@link #dispose()}. Usually it is assigned at construction time
+	 * or in {@link #render(float)}.
 	 */
 	protected Stage stage;
 
@@ -71,16 +70,15 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 	 * Here's what the content of {@code ssi} must be:
 	 * 
 	 * <ol>
-	 * <li>A size manager that is correct w.r.t. to the current screen size. It
-	 * is usually built by inspecting the current screen size (see
+	 * <li>A size manager that is correct w.r.t. to the current screen size. It is
+	 * usually built by inspecting the current screen size (see
 	 * {@link com.badlogic.gdx.Gdx#graphics}) and a cell size you want.
 	 * 
 	 * <p>
-	 * The screen's size is not computed automatically by this constructor,
-	 * because usually you can build a single instance of
-	 * {@link ScreenSizeManager} at startup, and pass it along all
-	 * {@link AbstractSquidScreen}. The instance will only change when there's
-	 * some resizing (i.e. when ligdx calls
+	 * The screen's size is not computed automatically by this constructor, because
+	 * usually you can build a single instance of {@link ScreenSizeManager} at
+	 * startup, and pass it along all {@link AbstractSquidScreen}. The instance will
+	 * only change when there's some resizing (i.e. when ligdx calls
 	 * {@link ScreenAdapter#resize(int, int)}).
 	 * </p>
 	 * </li>
@@ -101,9 +99,9 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 			disposed = true;
 
 			/*
-			 * Either we're moving to a new screen, in which case this avoids
-			 * glitches if the new screen does not paint everything; or we're
-			 * leaving in which case we don't care.
+			 * Either we're moving to a new screen, in which case this avoids glitches if
+			 * the new screen does not paint everything; or we're leaving in which case we
+			 * don't care.
 			 */
 			clearScreen();
 
@@ -128,25 +126,23 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 	}
 
 	/**
-	 * Implementations of this method should likely inspect {@link #disposed}
-	 * and {@link #resized}. When {@link #resized} holds, this method typically
-	 * returns an instance that is a variation of {@code this}, where the font
-	 * size has been changed (to get the new size, use {@link #sizeManager}; it
-	 * has been updated already). When {@link #disposed} holds, the usual
-	 * behavior is for this method to return null to quit the whole application
-	 * (that's the assumption that
-	 * {@link squidpony.squidgrid.gui.gdx.SquidApplicationAdapter} does) or to
-	 * return another screen to move forward (for example when switching from
-	 * the main/splash screen to the game's screen).
+	 * Implementations of this method should likely inspect {@link #disposed} and
+	 * {@link #resized}. When {@link #resized} holds, this method typically returns
+	 * an instance that is a variation of {@code this}, where the font size has been
+	 * changed (to get the new size, use {@link #sizeManager}; it has been updated
+	 * already). When {@link #disposed} holds, the usual behavior is for this method
+	 * to return null to quit the whole application or to return another screen to
+	 * move forward (for example when switching from the main/splash screen to the
+	 * game's screen).
 	 * 
 	 * <p>
-	 * This method is normally called when the user is moving to the next screen
-	 * (so that's your game logic) or when {@link #isDisposed()} holds or when
+	 * This method is normally called when the user is moving to the next screen (so
+	 * that's your game logic) or when {@link #isDisposed()} holds or when
 	 * {@link #hasPendingResize()} holds.
 	 * </p>
 	 * 
-	 * @return The screen to use after this one, or {@code null} if the
-	 *         application is quitting.
+	 * @return The screen to use after this one, or {@code null} if the application
+	 *         is quitting.
 	 */
 	public abstract /* @Nullable */ AbstractSquidScreen<T> getNext();
 
@@ -184,16 +180,15 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 
 	/**
 	 * @param desiredCellSize
-	 * @return A screen wide squid panel, margins-aware, and with its position
-	 *         set.
+	 * @return A screen wide squid panel, margins-aware, and with its position set.
 	 */
 	protected final SquidPanel buildScreenWideSquidPanel(int desiredCellSize) {
 		return ipb.buildScreenWide(sizeManager.screenWidth, sizeManager.screenHeight, desiredCellSize, null);
 	}
 
 	/**
-	 * @return A screen wide squid panel, margins-aware, and with its position
-	 *         set. It uses the current cell size.
+	 * @return A screen wide squid panel, margins-aware, and with its position set.
+	 *         It uses the current cell size.
 	 */
 	protected final SquidPanel buildScreenWideSquidPanel() {
 		final SquidPanel result = buildSquidPanel(sizeManager.wCells, sizeManager.hCells);
@@ -204,8 +199,8 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 	/**
 	 * @param width
 	 * @param height
-	 * @return A panel of size {@code (width, height)} that uses the default
-	 *         cell width/cell height. Its position isn't set.
+	 * @return A panel of size {@code (width, height)} that uses the default cell
+	 *         width/cell height. Its position isn't set.
 	 */
 	protected final SquidPanel buildSquidPanel(int width, int height) {
 		return buildSquidPanel(width, height, sizeManager.cellWidth, sizeManager.cellHeight);
@@ -216,8 +211,8 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 	 * @param height
 	 * @param cellWidth
 	 * @param cellHeight
-	 * @return A panel of size {@code (width, height)} that has {@code cellSize}
-	 *         . Its position isn't set.
+	 * @return A panel of size {@code (width, height)} that has {@code cellSize} .
+	 *         Its position isn't set.
 	 */
 	protected final SquidPanel buildSquidPanel(int width, int height, int cellWidth, int cellHeight) {
 		return ipb.buildByCells(width, height, cellWidth, cellHeight, null);
@@ -229,8 +224,7 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 	}
 
 	/**
-	 * @return Whether this screen should be thrown away when a resize event
-	 *         occurs.
+	 * @return Whether this screen should be thrown away when a resize event occurs.
 	 */
 	/* You should return false if you handle resizing on your own */
 	protected boolean disposeAtResize() {
@@ -250,8 +244,7 @@ public abstract class AbstractSquidScreen<T extends Color> extends ScreenAdapter
 		final T c = getClearingColor();
 		if (renderer == null)
 			renderer = new ShapeRenderer();
-		UIUtil.drawRectangle(renderer, 0, 0, sizeManager.screenWidth, sizeManager.screenHeight,
-				ShapeType.Filled, c);
+		UIUtil.drawRectangle(renderer, 0, 0, sizeManager.screenWidth, sizeManager.screenHeight, ShapeType.Filled, c);
 	}
 
 	/**

+ 11 - 12
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/LinesPanel.java

@@ -1,5 +1,8 @@
 package squidpony.squidgrid.gui.gdx;
 
+import java.util.LinkedList;
+import java.util.ListIterator;
+
 import com.badlogic.gdx.graphics.Color;
 import com.badlogic.gdx.graphics.g2d.Batch;
 import com.badlogic.gdx.graphics.g2d.BitmapFont;
@@ -11,17 +14,16 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
 import com.badlogic.gdx.math.MathUtils;
 import com.badlogic.gdx.scenes.scene2d.Actor;
 import com.badlogic.gdx.utils.Align;
+
 import squidpony.panel.IColoredString;
 import squidpony.panel.IMarkup;
 
-import java.util.LinkedList;
-import java.util.ListIterator;
-
 /**
  * An actor capable of drawing {@link IColoredString}s. It is lines-oriented:
  * putting a line may erase a line put before. It is designed to write text with
- * a variable-width font (as opposed to {@link SquidPanel}). It performs line wrapping by
- * default. It can write from top to bottom or from bottom to top (the default).
+ * a variable-width font (as opposed to {@link SquidPanel}). It performs line
+ * wrapping by default. It can write from top to bottom or from bottom to top
+ * (the default).
  * 
  * <p>
  * This
@@ -33,25 +35,22 @@ import java.util.ListIterator;
  * <p>
  * This class is usually used as follows:
  * 
- * <pre>
+ * <code>
  * final int nbLines = LinesPanel.computeMaxLines(font, pixelHeight);
- * final LinesPanel<Color> lp = new LinesPanel(new GDXMarkup(), font, nbLines);
+ * final LinesPanel&lt;Color&gt; lp = new LinesPanel(new GDXMarkup(), font, nbLines);
  * lp.setSize(pixelWidth, pixelHeight);
  * stage.addActor(lp);
- * </pre>
+ * </code>
  * </p>
  * 
  * <p>
- * Contrary to {@link SquidMessageBox}, this panel doesn't support scrolling
+ * Contrary to {@code SquidMessageBox}, this panel doesn't support scrolling
  * (for now). So it's suited when it is fine forgetting old messages (as in
  * brogue's messages area).
  * </p>
  * 
  * @author smelC
  * @param <T>
- * 
- * @see SquidMessageBox An alternative, doing similar lines-drawing business,
- *      but being backed up by {@link SquidPanel}.
  */
 public class LinesPanel<T extends Color> extends Actor {
 

+ 0 - 9
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/SquidPanel.java

@@ -11,7 +11,6 @@ import com.badlogic.gdx.scenes.scene2d.Group;
 import com.badlogic.gdx.scenes.scene2d.actions.Actions;
 import com.badlogic.gdx.utils.Align;
 
-import squidpony.IColorCenter;
 import squidpony.panel.ISquidPanel;
 
 /**
@@ -51,10 +50,6 @@ public final class SquidPanel extends Group implements ISquidPanel<Color> {
 	 *            the number of cells vertically
 	 * @param factory
 	 *            the factory to use for cell rendering
-	 * @param assetManager
-	 * @param center
-	 *            The color center to use. Can be {@code null}, but then must be set
-	 *            later on with {@link #setColorCenter(IColorCenter)}.
 	 */
 	public SquidPanel(int gridWidth, int gridHeight, TextCellFactory factory, float xOffset,
 			float yOffset) {
@@ -250,10 +245,6 @@ public final class SquidPanel extends Group implements ISquidPanel<Color> {
 	}
 
 	/**
-	 * Like {@link #tint(int, int, Color, float)}, but waits for {@code delay} (in
-	 * seconds) before performing it. Additionally, enqueue {@code postRunnable} for
-	 * running after the created action ends.
-	 * 
 	 * @param delay
 	 *            how long to wait in milliseconds before starting the effect
 	 * @param x

+ 1 - 9
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/SquidPanelBuilder.java

@@ -2,13 +2,10 @@ package squidpony.squidgrid.gui.gdx;
 
 import com.badlogic.gdx.assets.AssetDescriptor;
 import com.badlogic.gdx.assets.AssetManager;
-import com.badlogic.gdx.graphics.Color;
 import com.badlogic.gdx.graphics.Texture.TextureFilter;
 import com.badlogic.gdx.graphics.g2d.BitmapFont;
 import com.badlogic.gdx.graphics.g2d.TextureRegion;
 
-import squidpony.IColorCenter;
-
 /**
  * An almost-concrete implementation of {@link IPanelBuilder}. This class makes
  * the assumption that font files are only available for square and even sizes.
@@ -26,7 +23,6 @@ import squidpony.IColorCenter;
  */
 public abstract class SquidPanelBuilder extends IPanelBuilder.Skeleton {
 
-	protected final /* @Nullable */ IColorCenter<Color> icc;
 	public final /* @Nullable */ AssetManager assetManager;
 
 	protected final int smallestFont;
@@ -42,15 +38,11 @@ public abstract class SquidPanelBuilder extends IPanelBuilder.Skeleton {
 	 * @param fontOffset
 	 *            This offset is added to the cell size when computing the font size
 	 *            for a given cell size.
-	 * @param icc
-	 *            The color center to give to
-	 *            {@link SquidPanel#setColorCenter(IColorCenter)}, or {@code null}
 	 *            not to call this method.
 	 * @param assetManager
 	 */
-	public SquidPanelBuilder(int smallestFont, int largestFont, int fontOffset, /* @Nullable */IColorCenter<Color> icc,
+	public SquidPanelBuilder(int smallestFont, int largestFont, int fontOffset,
 			/* @Nullable */ AssetManager assetManager) {
-		this.icc = icc;
 		this.assetManager = assetManager;
 
 		this.smallestFont = smallestFont;

+ 147 - 156
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/TextCellFactory.java

@@ -1,6 +1,5 @@
 package squidpony.squidgrid.gui.gdx;
 
-import com.badlogic.gdx.assets.AssetManager;
 import com.badlogic.gdx.graphics.Color;
 import com.badlogic.gdx.graphics.Pixmap;
 import com.badlogic.gdx.graphics.Texture;
@@ -37,13 +36,8 @@ import squidpony.squidmath.OrderedMap;
  */
 public class TextCellFactory implements Disposable {
 
-	/**
-	 * The commonly used symbols in roguelike games.
-	 */
-	public static final String DEFAULT_FITTING = "@!#$%^&*()_+1234567890-=~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;:,'\"{}?/\\ ",
-			LINE_FITTING = "┼├┤┴┬┌┐└┘│─", SQUID_FITTING = DEFAULT_FITTING + LINE_FITTING;
-
 	private final BitmapFont bmpFont;
+
 	protected Texture block = null;
 	protected String fitting = SQUID_FITTING;
 	protected int width = 1, height = 1;
@@ -54,18 +48,15 @@ public class TextCellFactory implements Disposable {
 	protected float descent;
 	private Label.LabelStyle style;
 	protected OrderedMap<String, String> swap = new OrderedMap<>(32);
+	/**
+	 * The commonly used symbols in roguelike games.
+	 */
+	public static final String DEFAULT_FITTING = "@!#$%^&*()_+1234567890-=~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;:,'\"{}?/\\ ",
+			LINE_FITTING = "┼├┤┴┬┌┐└┘│─", SQUID_FITTING = DEFAULT_FITTING + LINE_FITTING;
 
 	/**
-	 * A default valued factory that uses the given {@link AssetManager} to load the
-	 * font file. Use this constructor if you are likely to load the same font over
-	 * and over (recall that, without an {@link AssetManager}, each instance of
-	 * {@link TextCellFactory} will load its font from disk). This primarily matters
-	 * if you are using fonts not bundled with SquidLib, since accessing a
-	 * BitmapFont with a method (not a String) from DefaultResources caches the
-	 * BitmapFont already.
-	 *
-	 * @param assetManager
-	 *            an ordinary libGDX AssetManager
+	 * @param font
+	 *            The font to use
 	 */
 	public TextCellFactory(BitmapFont font) {
 		this.bmpFont= font;
@@ -73,103 +64,47 @@ public class TextCellFactory implements Disposable {
 	}
 
 	/**
-	 * Initializes the factory to then be able to create text cells on demand.
-	 *
-	 * Will match the width and height to 12 and 12, scaling the font to fit.
-	 *
-	 * Calling this after the factory has already been initialized will
-	 * re-initialize it.
-	 *
-	 * @return this for method chaining
-	 */
-	public TextCellFactory initByFont() {
-		bmpFont.setFixedWidthGlyphs(fitting);
-		width = (int) bmpFont.getSpaceWidth();
-		height = (int) (bmpFont.getLineHeight());
-		descent = bmpFont.getDescent();
-
-		actualCellWidth = width;
-		actualCellHeight = height;
-		// modifiedHeight = height;
-		Pixmap temp = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
-		temp.setColor(Color.WHITE);
-		temp.fill();
-		block = new Texture(1, 1, Pixmap.Format.RGBA8888);
-		block.draw(temp, 0, 0);
-		temp.dispose();
-		style = new Label.LabelStyle(bmpFont, null);
-		initialized = true;
-		return this;
-	}
-
-	/**
-	 * Returns the font used by this factory.
-	 *
-	 * @return the font
-	 */
-	public BitmapFont font() {
-		return bmpFont;
-	}
-
-	/**
-	 * Returns the width of a single cell.
-	 *
-	 * @return the width
-	 */
-	public int width() {
-		return width;
-	}
-
-	/**
-	 * Sets the factory's cell width to the provided value. Clamps at 1 on the lower
-	 * bound to ensure valid calculations.
-	 *
-	 * @param width
-	 *            the desired width
-	 * @return this factory for method chaining
-	 */
-	public TextCellFactory width(int width) {
-		this.width = Math.max(1, width);
-		actualCellWidth = this.width;
-		return this;
-	}
-
-	/**
-	 * Returns the height of a single cell.
+	 * If using a distance field font, you MUST call this at some point while the
+	 * batch has begun, or use code that calls it for you (which is now much of
+	 * SquidLib). A typical point to call it is in the "void draw(Batch batch, float
+	 * parentAlpha)" method or an overriding method for a Scene2D class. You should
+	 * call configureShader rarely, typically only a few times per frame if there
+	 * are no images to render, and this means the logical place to call it is in
+	 * the outermost Group that contains any SquidPanel objects or other widgets. If
+	 * you have multipleTextCellFactory objects, each one needs to have
+	 * configureShader called before it is used to draw. <br>
+	 * SquidLayers and SquidPanel already call this method in their draw overrides,
+	 * so you don't need to call this manually if you use SquidLayers or SquidPanel.
+	 * <br>
+	 * If you don't use a distance field font, you don't need to call this, but
+	 * calling it won't cause problems.
 	 *
-	 * @return the height of a single cell
+	 * @param batch
+	 *            the Batch, such as a SpriteBatch, to configure to render distance
+	 *            field fonts if necessary.
 	 */
-	public int height() {
-		return height;
-	}
+	public void configureShader(Batch batch) {
+		if (initialized && distanceField) {
+			batch.setShader(shader);
+			shader.setUniformf("u_smoothing", 3.5f * bmpFont.getData().scaleX);
 
-	/**
-	 * Sets the factory's cell height to the provided value. Clamps at 1 on the
-	 * lower bound to ensure valid calculations.
-	 *
-	 * @param height
-	 *            the desired width
-	 * @return this factory for method chaining
-	 */
-	public TextCellFactory height(int height) {
-		this.height = Math.max(1, height);
-		actualCellHeight = this.height;
-		return this;
+		}
 	}
 
 	/**
-	 * Returns true if this factory is fully initialized and ready to build text
-	 * cells.
-	 *
-	 * @return true if initialized
+	 * Releases all resources of this object.
 	 */
-	public boolean initialized() {
-		return initialized;
+	@Override
+	public void dispose() {
+		if (bmpFont != null)
+			bmpFont.dispose();
+		if (block != null)
+			block.dispose();
 	}
 
 	/**
-	 * Use the specified Batch to draw a String (often just one char long) with the
-	 * default color (white), with x and y determining the world-space coordinates
+	 * Use the specified Batch to draw a String (often just one char long) in the
+	 * specified LibGDX Color, with x and y determining the world-space coordinates
 	 * for the upper-left corner.
 	 *
 	 * @param batch
@@ -177,6 +112,8 @@ public class TextCellFactory implements Disposable {
 	 * @param s
 	 *            the string to draw, often but not necessarily one char. Can be
 	 *            null to draw a solid block instead.
+	 * @param color
+	 *            the LibGDX Color to draw the char(s) with, all the same color
 	 * @param x
 	 *            x of the upper-left corner of the region of text in world
 	 *            coordinates.
@@ -184,24 +121,24 @@ public class TextCellFactory implements Disposable {
 	 *            y of the upper-left corner of the region of text in world
 	 *            coordinates.
 	 */
-	public void draw(Batch batch, String s, float x, float y) {
+	public void draw(Batch batch, String s, Color color, float x, float y) {
 		if (!initialized) {
 			throw new IllegalStateException("This factory has not yet been initialized!");
 		}
 
-		// + descent * 3 / 2f
-		// - distanceFieldScaleY / 12f
-
-		// height - lineTweak * 2f
 		if (s == null) {
-			batch.setColor(1f, 1f, 1f, 1f);
-			batch.draw(block, x, y - actualCellHeight, actualCellWidth, actualCellHeight); // + descent * 1 / 3f
+			Color orig = batch.getColor();
+			batch.setColor(color);
+			batch.draw(block, x, y - actualCellHeight, actualCellWidth, actualCellHeight); // descent * 1 / 3f
+			batch.setColor(orig);
 		} else if (s.length() > 0 && s.charAt(0) == '\0') {
-			batch.setColor(1f, 1f, 1f, 1f);
+			Color orig = batch.getColor();
+			batch.setColor(color);
 			batch.draw(block, x, y - actualCellHeight, actualCellWidth * s.length(), actualCellHeight); // descent * 1 /
 																										// 3f
+			batch.setColor(orig);
 		} else {
-			bmpFont.setColor(1f, 1f, 1f, 1f);
+			bmpFont.setColor(color);
 			if (swap.containsKey(s))
 				bmpFont.draw(batch, swap.get(s), x,
 						y - descent + 1/* * 1.5f *//* - lineHeight * 0.2f */ /* + descent */, width * s.length(),
@@ -213,8 +150,8 @@ public class TextCellFactory implements Disposable {
 	}
 
 	/**
-	 * Use the specified Batch to draw a String (often just one char long) in the
-	 * specified LibGDX Color, with x and y determining the world-space coordinates
+	 * Use the specified Batch to draw a String (often just one char long) with the
+	 * default color (white), with x and y determining the world-space coordinates
 	 * for the upper-left corner.
 	 *
 	 * @param batch
@@ -222,8 +159,6 @@ public class TextCellFactory implements Disposable {
 	 * @param s
 	 *            the string to draw, often but not necessarily one char. Can be
 	 *            null to draw a solid block instead.
-	 * @param color
-	 *            the LibGDX Color to draw the char(s) with, all the same color
 	 * @param x
 	 *            x of the upper-left corner of the region of text in world
 	 *            coordinates.
@@ -231,24 +166,24 @@ public class TextCellFactory implements Disposable {
 	 *            y of the upper-left corner of the region of text in world
 	 *            coordinates.
 	 */
-	public void draw(Batch batch, String s, Color color, float x, float y) {
+	public void draw(Batch batch, String s, float x, float y) {
 		if (!initialized) {
 			throw new IllegalStateException("This factory has not yet been initialized!");
 		}
 
+		// + descent * 3 / 2f
+		// - distanceFieldScaleY / 12f
+
+		// height - lineTweak * 2f
 		if (s == null) {
-			Color orig = batch.getColor();
-			batch.setColor(color);
-			batch.draw(block, x, y - actualCellHeight, actualCellWidth, actualCellHeight); // descent * 1 / 3f
-			batch.setColor(orig);
+			batch.setColor(1f, 1f, 1f, 1f);
+			batch.draw(block, x, y - actualCellHeight, actualCellWidth, actualCellHeight); // + descent * 1 / 3f
 		} else if (s.length() > 0 && s.charAt(0) == '\0') {
-			Color orig = batch.getColor();
-			batch.setColor(color);
+			batch.setColor(1f, 1f, 1f, 1f);
 			batch.draw(block, x, y - actualCellHeight, actualCellWidth * s.length(), actualCellHeight); // descent * 1 /
 																										// 3f
-			batch.setColor(orig);
 		} else {
-			bmpFont.setColor(color);
+			bmpFont.setColor(1f, 1f, 1f, 1f);
 			if (swap.containsKey(s))
 				bmpFont.draw(batch, swap.get(s), x,
 						y - descent + 1/* * 1.5f *//* - lineHeight * 0.2f */ /* + descent */, width * s.length(),
@@ -259,6 +194,78 @@ public class TextCellFactory implements Disposable {
 		}
 	}
 
+	/**
+	 * Returns the font used by this factory.
+	 *
+	 * @return the font
+	 */
+	public BitmapFont font() {
+		return bmpFont;
+	}
+
+	/**
+	 * Returns the height of a single cell.
+	 *
+	 * @return the height of a single cell
+	 */
+	public int height() {
+		return height;
+	}
+
+	/**
+	 * Sets the factory's cell height to the provided value. Clamps at 1 on the
+	 * lower bound to ensure valid calculations.
+	 *
+	 * @param height
+	 *            the desired width
+	 * @return this factory for method chaining
+	 */
+	public TextCellFactory height(int height) {
+		this.height = Math.max(1, height);
+		actualCellHeight = this.height;
+		return this;
+	}
+
+	/**
+	 * Initializes the factory to then be able to create text cells on demand.
+	 *
+	 * Will match the width and height to 12 and 12, scaling the font to fit.
+	 *
+	 * Calling this after the factory has already been initialized will
+	 * re-initialize it.
+	 *
+	 * @return this for method chaining
+	 */
+	public TextCellFactory initByFont() {
+		bmpFont.setFixedWidthGlyphs(fitting);
+		width = (int) bmpFont.getSpaceWidth();
+		height = (int) (bmpFont.getLineHeight());
+		descent = bmpFont.getDescent();
+
+		actualCellWidth = width;
+		actualCellHeight = height;
+		// modifiedHeight = height;
+		Pixmap temp = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
+		temp.setColor(Color.WHITE);
+		temp.fill();
+		block = new Texture(1, 1, Pixmap.Format.RGBA8888);
+		block.draw(temp, 0, 0);
+		temp.dispose();
+		style = new Label.LabelStyle(bmpFont, null);
+		initialized = true;
+		return this;
+	}
+
+	/**
+	 * Returns true if this factory is fully initialized and ready to build text
+	 * cells.
+	 *
+	 * @return true if initialized
+	 */
+	public boolean initialized() {
+		return initialized;
+	}
+
 	/**
 	 * Converts a String into a Label, or if the argument s is null, creates an
 	 * Image of a solid block. Can be used for preparing glyphs for animation
@@ -309,41 +316,25 @@ public class TextCellFactory implements Disposable {
 	}
 
 	/**
-	 * If using a distance field font, you MUST call this at some point while the
-	 * batch has begun, or use code that calls it for you (which is now much of
-	 * SquidLib). A typical point to call it is in the "void draw(Batch batch, float
-	 * parentAlpha)" method or an overriding method for a Scene2D class. You should
-	 * call configureShader rarely, typically only a few times per frame if there
-	 * are no images to render, and this means the logical place to call it is in
-	 * the outermost Group that contains any SquidPanel objects or other widgets. If
-	 * you have multipleTextCellFactory objects, each one needs to have
-	 * configureShader called before it is used to draw. <br>
-	 * SquidLayers and SquidPanel already call this method in their draw overrides,
-	 * so you don't need to call this manually if you use SquidLayers or SquidPanel.
-	 * <br>
-	 * If you don't use a distance field font, you don't need to call this, but
-	 * calling it won't cause problems.
+	 * Returns the width of a single cell.
 	 *
-	 * @param batch
-	 *            the Batch, such as a SpriteBatch, to configure to render distance
-	 *            field fonts if necessary.
+	 * @return the width
 	 */
-	public void configureShader(Batch batch) {
-		if (initialized && distanceField) {
-			batch.setShader(shader);
-			shader.setUniformf("u_smoothing", 3.5f * bmpFont.getData().scaleX);
-
-		}
+	public int width() {
+		return width;
 	}
 
 	/**
-	 * Releases all resources of this object.
+	 * Sets the factory's cell width to the provided value. Clamps at 1 on the lower
+	 * bound to ensure valid calculations.
+	 *
+	 * @param width
+	 *            the desired width
+	 * @return this factory for method chaining
 	 */
-	@Override
-	public void dispose() {
-		if (bmpFont != null)
-			bmpFont.dispose();
-		if (block != null)
-			block.dispose();
+	public TextCellFactory width(int width) {
+		this.width = Math.max(1, width);
+		actualCellWidth = this.width;
+		return this;
 	}
 }

+ 6 - 14
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/UIUtil.java

@@ -16,8 +16,8 @@ import com.badlogic.gdx.utils.Pools;
 public class UIUtil {
 
 	/**
-	 * Writes {@code text} at {@code (x, y)} by cuttinga using "…" if it gets
-	 * wider than {@code width}.
+	 * Writes {@code text} at {@code (x, y)} by cuttinga using "…" if it gets wider
+	 * than {@code width}.
 	 * 
 	 * @param batch
 	 * @param font
@@ -27,7 +27,7 @@ public class UIUtil {
 	 * @param color
 	 *            The text's color
 	 * @param align
-	 *            The alignment (see {@link Align}).
+	 *            The alignment (see {@code Align}).
 	 * @param width
 	 *            The desired width of the text
 	 * @param x
@@ -282,20 +282,12 @@ public class UIUtil {
 	public static enum CornerStyle {
 		SQUARE,
 		/**
-		 * Here's an example of this style:
-		 * 
-		 * <br>
-		 * 
-		 * <img src="http://i.imgur.com/AQgWeic.png"/>.
+		 * Here's an example of this style http://i.imgur.com/AQgWeic.png
 		 */
 		ROUNDED,
 		/**
-		 * A NES-like style (to my taste..). Try it, I can't explain it with
-		 * sentences. Here's an example:
-		 * 
-		 * <br>
-		 * 
-		 * <img src="http://i.imgur.com/PQSvT0t.png"/>
+		 * A NES-like style (to my taste..). Try it, I can't explain it with sentences.
+		 * Here's an example: http://i.imgur.com/PQSvT0t.png
 		 */
 		MISSING,
 	}