Parcourir la source

Delete stuff I don't use

smelc il y a 7 ans
Parent
commit
dde6d43e12

+ 0 - 143
squidlib-util/src/main/java/squidpony/DamerauLevenshteinAlgorithm.java

@@ -1,143 +0,0 @@
-package squidpony;
-
-import squidpony.annotation.Beta;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The Damerau-Levenshtein Algorithm is an extension to the Levenshtein
- * Algorithm which solves the edit distance problem between a source string and
- * a target string with the following operations:
- *
- * <ul>
- * <li>Character Insertion</li>
- * <li>Character Deletion</li>
- * <li>Character Replacement</li>
- * <li>Adjacent Character Swap</li>
- * </ul>
- *
- * Note that the adjacent character swap operation is an edit that may be
- * applied when two adjacent characters in the source string match two adjacent
- * characters in the target string, but in reverse order, rather than a general
- * allowance for adjacent character swaps.
- *
- * This implementation allows the client to specify the costs of the various
- * edit operations with the restriction that the cost of two swap operations
- * must not be less than the cost of a delete operation followed by an insert
- * operation. This restriction is required to preclude two swaps involving the
- * same character being required for optimality which, in turn, enables a fast
- * dynamic programming solution.
- *
- * The running time of the Damerau-Levenshtein algorithm is O(n*m) where n is
- * the length of the source string and m is the length of the target string.
- * This implementation consumes O(n*m) space.
- * 
-* @author Kevin L. Stern
- */
-@Beta
-public class DamerauLevenshteinAlgorithm {
-
-    private final int deleteCost, insertCost, replaceCost, swapCost;
-
-    /**
-     * Constructor.
-     *     
-* @param deleteCost the cost of deleting a character.
-     * @param insertCost the cost of inserting a character.
-     * @param replaceCost the cost of replacing a character.
-     * @param swapCost the cost of swapping two adjacent characters.
-     */
-    public DamerauLevenshteinAlgorithm(int deleteCost, int insertCost, int replaceCost, int swapCost) {
-        /*
-         * Required to facilitate the premise to the algorithm that two swaps of
-         * the same character are never required for optimality.
-         */
-        if (2 * swapCost < insertCost + deleteCost) {
-            throw new IllegalArgumentException("Unsupported cost assignment");
-        }
-        this.deleteCost = deleteCost;
-        this.insertCost = insertCost;
-        this.replaceCost = replaceCost;
-        this.swapCost = swapCost;
-    }
-
-    /**
-     * Compute the Damerau-Levenshtein distance between the specified source
-     * string and the specified target string.
-     */
-    public int execute(String source, String target) {
-        if (source.length() == 0) {
-            return target.length() * insertCost;
-        }
-
-        if (target.length() == 0) {
-            return source.length() * deleteCost;
-        }
-
-        int[][] table = new int[source.length()][target.length()];
-        Map<Character, Integer> sourceIndexByCharacter = new HashMap<>();
-
-        if (source.charAt(0) != target.charAt(0)) {
-            table[0][0] = Math.min(replaceCost, deleteCost + insertCost);
-        }
-
-        sourceIndexByCharacter.put(source.charAt(0), 0);
-
-        for (int i = 1; i < source.length(); i++) {
-            int deleteDistance = table[i - 1][0] + deleteCost;
-            int insertDistance = (i + 1) * deleteCost + insertCost;
-            int matchDistance = i * deleteCost
-                    + (source.charAt(i) == target.charAt(0) ? 0 : replaceCost);
-            table[i][0] = Math.min(Math.min(deleteDistance, insertDistance),
-                    matchDistance);
-        }
-
-        for (int j = 1; j < target.length(); j++) {
-            int deleteDistance = table[0][j - 1] + insertCost;
-            int insertDistance = (j + 1) * insertCost + deleteCost;
-            int matchDistance = j * insertCost
-                    + (source.charAt(0) == target.charAt(j) ? 0 : replaceCost);
-            table[0][j] = Math.min(Math.min(deleteDistance, insertDistance),
-                    matchDistance);
-        }
-
-        for (int i = 1; i < source.length(); i++) {
-            int maxSourceLetterMatchIndex = source.charAt(i) == target
-                    .charAt(0) ? 0 : -1;
-            for (int j = 1; j < target.length(); j++) {
-                Integer candidateSwapIndex = sourceIndexByCharacter.get(target
-                        .charAt(j));
-                int jSwap = maxSourceLetterMatchIndex;
-                int deleteDistance = table[i - 1][j] + deleteCost;
-                int insertDistance = table[i][j - 1] + insertCost;
-                int matchDistance = table[i - 1][j - 1];
-                if (source.charAt(i) != target.charAt(j)) {
-                    matchDistance += replaceCost;
-                } else {
-                    maxSourceLetterMatchIndex = j;
-                }
-                int swapDistance;
-                if (candidateSwapIndex != null && jSwap != -1) {
-                    int iSwap = candidateSwapIndex;
-                    int preSwapCost;
-                    if (iSwap == 0 && jSwap == 0) {
-                        preSwapCost = 0;
-                    } else {
-                        preSwapCost = table[Math.max(0, iSwap - 1)][Math.max(0,
-                                jSwap - 1)];
-                    }
-                    swapDistance = preSwapCost + (i - iSwap - 1) * deleteCost
-                            + (j - jSwap - 1) * insertCost + swapCost;
-                } else {
-                    swapDistance = Integer.MAX_VALUE;
-                }
-                table[i][j] = Math.min(
-                        Math.min(Math.min(deleteDistance, insertDistance),
-                                matchDistance), swapDistance);
-            }
-            sourceIndexByCharacter.put(source.charAt(i), i);
-        }
-        return table[source.length() - 1][target.length() - 1];
-    }
-}

+ 0 - 146
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/AbstractTextScreen.java

@@ -1,146 +0,0 @@
-package squidpony.squidgrid.gui.gdx;
-
-import com.badlogic.gdx.graphics.Color;
-import squidpony.panel.IColoredString;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * A screen designed to write some text in full screen. This class supports text
- * alignment (left, center, right) and text wrapping (see {@link #wrap(int)}).
- * 
- * <p>
- * If you use libgdx {@link Color} as your type of color, you can use a less
- * abstract subtype: {@link TextScreen}, but that relies on some older, less-pretty
- * rendering done by the deprecated class {@link GroupCombinedPanel}, and you may
- * prefer using {@link TextPanel} or sometimes {@link LinesPanel} where you want
- * to display more than a few words of legible wrapped text.
- * </p>
- * 
- * @author smelC
- * 
- * @see TextScreen
- */
-public abstract class AbstractTextScreen<T extends Color> extends AbstractSquidScreen<T> {
-
-	/** Can contain null members (denoting empty lines) */
-	protected List<IColoredString<T>> text;
-	protected /* @Nullable */ int[] alignment;
-
-	/**
-	 * @param ssi
-	 *            See super class
-	 * @param text
-	 *            The text to display. From top to bottom. Use {@code null}
-	 *            members to jump lines.
-	 * 
-	 *            <p>
-	 *            Give {@code null} if you wanna set it later (using
-	 *            {@link #init(List, int[])}).
-	 *            </p>
-	 * @param alignment
-	 *            How to alignment members of {@code text}. -1 for left, 0 for
-	 *            center, 1 for right. The default is to align left
-	 * 
-	 *            <p>
-	 *            Give {@code null} if you wanna set it later (using
-	 *            {@link #init(List, int[])}).
-	 *            </p>
-	 */
-	public AbstractTextScreen(SquidScreenInput<T> ssi, /* @Nullable */ List<IColoredString<T>> text,
-			/* @Nullable */ int[] alignment) {
-		super(ssi);
-		this.text = text;
-		this.alignment = alignment;
-	}
-
-	/**
-	 * You should call this method at most once. You should call this method
-	 * only before rendering this screen.
-	 * 
-	 * @param text
-	 *            The text to display. From top to bottom. Use {@code null}
-	 *            members to jump lines.
-	 * @param alignment
-	 *            How to alignment members of {@code text}. -1 for left, 0 for
-	 *            center, 1 for right. The default is to align left
-	 */
-	public void init(List<IColoredString<T>> text, /* @Nullable */ int[] alignment) {
-		this.text = text;
-		this.alignment = alignment;
-	}
-
-	/**
-	 * Wraps the text inside {@code this} according to {@code width}. This
-	 * screen's text must have been set already. This, of course, preserves the
-	 * text alignment (if any).
-	 * 
-	 * @param width
-	 * 
-	 * @throws IllegalStateException
-	 *             If {@code this}'s text hasn't been initialized yet.
-	 */
-	public void wrap(int width) {
-		if (text == null)
-			throw new IllegalStateException("Cannot wrap an unitialized " + getClass().getSimpleName());
-
-		final List<IColoredString<T>> tsave = text;
-		text = new ArrayList<>(tsave.size() * 2);
-		final int[] asave = alignment;
-		final /* @Nullable */ List<Integer> newAlignments = asave == null ? null
-				: new ArrayList<Integer>(asave.length * 2);
-		int i = 0;
-		for (IColoredString<T> t : tsave) {
-			/* Wrap line */
-			if (t == null) {
-				/* An empty line */
-				text.add(null);
-				if (newAlignments != null)
-					newAlignments.add(/* doesn't matter */ 0);
-			} else {
-				final List<IColoredString<T>> wrapped = t.wrap(width);
-				final /* @Nullable */Integer alignment = asave == null || asave.length <= i ? null : asave[i];
-				for (IColoredString<T> line : wrapped) {
-					/* Add wrapped */
-					text.add(line);
-					if (newAlignments != null && alignment != null)
-						/* Keep alignment */
-						newAlignments.add(alignment);
-				}
-			}
-			i++;
-		}
-		alignment = newAlignments == null ? null : toIntArray(newAlignments);
-	}
-
-	protected int[] toIntArray(Collection<Integer> l) {
-		final int[] result = new int[l.size()];
-		int j = 0;
-		for (int i : l)
-			result[j++] = i;
-		return result;
-	}
-
-	@Override
-	public String toString() {
-		final StringBuilder buf = new StringBuilder();
-		buf.append(getClass().getSimpleName());
-		if (text != null) {
-			/* Show text */
-			final Iterator<? extends IColoredString<?>> it = text.iterator();
-			final String eol = System.getProperty("line.separator");
-			buf.append(eol);
-			while (it.hasNext()) {
-				final IColoredString<?> ics = it.next();
-				buf.append(ics == null ? "" : ics.present());
-				if (it.hasNext())
-					buf.append(eol);
-			}
-		}
-		return buf.toString();
-	}
-
-}

+ 0 - 294
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/ColorChangeImage.java

@@ -1,294 +0,0 @@
-package squidpony.squidgrid.gui.gdx;
-
-import com.badlogic.gdx.graphics.Color;
-import com.badlogic.gdx.graphics.Texture;
-import com.badlogic.gdx.graphics.g2d.TextureRegion;
-import com.badlogic.gdx.scenes.scene2d.ui.Image;
-import squidpony.squidgrid.Direction;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * An Image that has multiple possible color tints that it cycles through over time.
- * Created by Tommy Ettinger on 3/23/2016.
- */
-public class ColorChangeImage extends Image {
-
-    private List<Color> colors;
-    private float progress = 0f;
-    private float loopTime = 2f;
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(Texture texture, List<Color> colors) {
-        this(texture, 2f, colors);
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(Texture texture, float loopTime, List<Color> colors) {
-        this(texture, loopTime, false, colors);
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param doubleWidth true if this takes up two grid cells; only matters if you use {@link AnimatedEntity#setDirection(Direction)}
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(Texture texture, float loopTime, boolean doubleWidth, List<Color> colors) {
-
-        super(texture);
-
-        if(colors == null || colors.isEmpty())
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else
-            this.colors = colors;
-        this.loopTime = loopTime;
-        setSize(texture.getWidth(), texture.getHeight());
-        setOrigin(doubleWidth ? 16 : 1); //Align.right or Align.center
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param doubleWidth true if this takes up two grid cells; only matters if you use {@link AnimatedEntity#setDirection(Direction)}
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(Texture texture, float loopTime, boolean doubleWidth, float width, float height, List<Color> colors) {
-
-        super(texture);
-
-        if(colors == null || colors.isEmpty())
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else
-            this.colors = colors;
-        this.loopTime = loopTime;
-        setSize(width, height);
-        setOrigin(doubleWidth ? 16 : 1); //Align.right or Align.center
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(Texture texture, float loopTime, Color... colors) {
-        this(texture, loopTime, false, colors);
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param doubleWidth true if this takes up two grid cells; only matters if you use {@link AnimatedEntity#setDirection(Direction)}
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(Texture texture, float loopTime, boolean doubleWidth, Color... colors) {
-        super(texture);
-
-        if(colors == null || colors.length == 0)
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else {
-            this.colors = new ArrayList<>(colors.length);
-            Collections.addAll(this.colors, colors);
-        }
-        this.loopTime = loopTime;
-        setSize(texture.getWidth(), texture.getHeight());
-        setOrigin(doubleWidth ? 16 : 1); //Align.right or Align.center
-    }
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param doubleWidth true if this takes up two grid cells; only matters if you use {@link AnimatedEntity#setDirection(Direction)}
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(Texture texture, float loopTime, boolean doubleWidth, float width, float height, Color... colors) {
-        super(texture);
-
-        if(colors == null || colors.length == 0)
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else {
-            this.colors = new ArrayList<>(colors.length);
-            Collections.addAll(this.colors, colors);
-        }
-        this.loopTime = loopTime;
-
-        setSize(width, height);
-        setOrigin(doubleWidth ? 16 : 1); //Align.right or Align.center
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(TextureRegion texture, List<Color> colors) {
-        this(texture, 2f, colors);
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(TextureRegion texture, float loopTime, List<Color> colors) {
-        this(texture, loopTime, false, colors);
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param doubleWidth true if this takes up two grid cells; only matters if you use {@link AnimatedEntity#setDirection(Direction)}
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(TextureRegion texture, float loopTime, boolean doubleWidth, List<Color> colors) {
-
-        super(texture);
-
-        if(colors == null || colors.isEmpty())
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else
-            this.colors = colors;
-        this.loopTime = loopTime;
-        setSize(texture.getRegionWidth(), texture.getRegionHeight());
-        setOrigin(doubleWidth ? 16 : 1); //Align.right or Align.center
-    }/**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param doubleWidth true if this takes up two grid cells; only matters if you use {@link AnimatedEntity#setDirection(Direction)}
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(TextureRegion texture, float loopTime, boolean doubleWidth, float width, float height, List<Color> colors) {
-
-        super(texture);
-
-        if(colors == null || colors.isEmpty())
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else
-            this.colors = colors;
-        this.loopTime = loopTime;
-        setSize(width, height);
-        setOrigin(doubleWidth ? 16 : 1); //Align.right or Align.center
-    }
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(TextureRegion texture, float loopTime, Color... colors) {
-        this(texture, loopTime, false, colors);
-    }
-
-    /**
-     * Creates an image stretched and aligned center, that will use the specified list of colors.
-     *
-     * @param texture the texture to use
-     * @param loopTime the amount of time, in seconds, to spend transitioning through the colors before repeating
-     * @param doubleWidth true if this takes up two grid cells; only matters if you use {@link AnimatedEntity#setDirection(Direction)}
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public ColorChangeImage(TextureRegion texture, float loopTime, boolean doubleWidth, Color... colors) {
-        super(texture);
-
-        if(colors == null || colors.length == 0)
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else {
-            this.colors = new ArrayList<>(colors.length);
-            Collections.addAll(this.colors, colors);
-        }
-        this.loopTime = loopTime;
-
-        setSize(texture.getRegionWidth(), texture.getRegionHeight());
-        setOrigin(doubleWidth ? 16 : 1); //Align.right or Align.center
-    }
-
-    /**
-     * Returns the color the actor will be tinted when drawn. Takes the Color from the List of Color this was constructed
-     * with or assigned with setColors, not the normal Actor color assigned with setColor.
-     * @return the Color this will be drawn with
-     */
-    @Override
-    public Color getColor() {
-        return colors.get((int)(progress * colors.size() / loopTime));
-    }
-
-    /**
-     * Sets the list of colors this uses to choose what color it draws with.
-     * @param colors a List of Color, such as one returned by SquidColorCenter's gradient or rainbow methods
-     */
-    public void setColors(List<Color> colors)
-    {
-        if(colors == null || colors.isEmpty())
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else
-            this.colors = colors;
-    }
-
-    /**
-     * Sets the list of colors this uses to choose what color it draws with.
-     * @param colors an array or vararg of Color
-     */
-    public void setColors(Color... colors)
-    {
-        if (colors == null || colors.length == 0)
-            this.colors = DefaultResources.getSCC().rainbow(12);
-        else {
-            this.colors = new ArrayList<>(colors.length);
-            Collections.addAll(this.colors, colors);
-        }
-    }
-    /**
-     * Updates the actor based on time. Typically this is called each frame by
-     * {@link com.badlogic.gdx.scenes.scene2d.Stage#act(float)}.
-     * <p>
-     * The default implementation calls
-     * {@link com.badlogic.gdx.scenes.scene2d.Action#act(float)} on each action and removes actions that are complete.
-     *
-     * @param delta Time in seconds since the last frame.
-     */
-    @Override
-    public void act(float delta) {
-        super.act(delta);
-        progress = (progress + delta) % (loopTime - 0.001f);
-    }
-
-    /**
-     * Changes the amount of time this takes to loop through all colors, and also resets the current loop to its start.
-     * @param loopTime the amount of time, in seconds, it takes to loop through all the colors in the list
-     */
-    public void resetLoopTime(float loopTime)
-    {
-        this.loopTime = loopTime;
-        progress = 0f;
-    }
-}

+ 0 - 792
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/SquidInput.java

@@ -1,792 +0,0 @@
-package squidpony.squidgrid.gui.gdx;
-
-import com.badlogic.gdx.Gdx;
-import com.badlogic.gdx.Input;
-import com.badlogic.gdx.InputAdapter;
-import com.badlogic.gdx.utils.CharArray;
-
-/**
- * This input processing class can handle mouse and keyboard input, using a squidpony.squidgrid.gui.gdx.SquidMouse for
- * Mouse input and a user implementation of the SquidInput.KeyHandler interface to react to keys represented as chars
- * and the modifiers those keys were pressed with, any of alt, ctrl, and/or shift. Not all keys are representable by
- * default in unicode, so symbolic representations are stored in constants in this class, and are passed to
- * KeyHandler.handle() as chars like DOWN_ARROW or its value, '\u2193'. Shift modifies the input as it would on a
- * QWERTY keyboard, and the exact mapping is documented in fromKey() as well. This class handles mouse input
- * immediately, but stores keypresses in a queue, storing all key events and allowing them to be processed one at a time
- * using next() or all at once using drain(). To have an effect, it needs to be registered by calling
- * Input.setInputProcessor(SquidInput).
- *
- * It does not perform the blocking functionality of earlier SquidKey implementations, because this is meant to run
- * in an event-driven libGDX game and should not step on the toes of libGDX's input handling. To block game logic
- * until an event has been received, check hasNext() in the game's render() method and effectively "block" by not
- * running game logic if hasNext() returns false. You can process an event if hasNext() returns true by calling next().
- * Mouse inputs do not affect hasNext(), and next() will process only key pressed events.
- *
- * @author Eben Howard - http://squidpony.com - howard@squidpony.com
- * @author Nathan Sweet
- * @author Tommy Ettinger
- * */
-public class SquidInput extends InputAdapter {
-    /**
-     * A single-method interface used to process "typed" characters, special characters produced by unusual keys, and
-     * modifiers that can affect them. SquidInput has numerous static char values that are expected to be passed
-     * to handle() in place of the special keys (such as arrow keys) that do not have a standard char value.
-     */
-    public interface KeyHandler{
-        /**
-         * The only method you need to implement yourself in KeyHandler, this should react to keys such as
-         * 'a' (produced by pressing the A key while not holding Shift), 'E' (produced by pressing the E key while
-         * holding Shift), and '\u2190' (left arrow in unicode, also available as a constant in SquidInput, produced by
-         * pressing the left arrow key even though that key does not have a default unicode representation). Capital
-         * letters will be capitalized when they are passed to this, but they may or may not have the shift argument as
-         * true depending on how this method was called. Symbols that may be produced by holding Shift and pressing a
-         * number or a symbol key can vary between keyboards (some may require Shift to be held down, others may not).
-         * <br>
-         * This can react to the input in whatever way you find appropriate for your game.
-         * @param key a char of the "typed" representation of the key, such as 'a' or 'E', or if there is no Unicode
-         *            character for the key, an appropriate alternate character as documented in SquidInput.fromKey()
-         * @param alt true if the Alt modifier was being held while this key was entered, false otherwise.
-         * @param ctrl true if the Ctrl modifier was being held while this key was entered, false otherwise.
-         * @param shift true if the Shift modifier was being held while this key was entered, false otherwise.
-         */
-        void handle(char key, boolean alt, boolean ctrl, boolean shift);
-    }
-
-    protected KeyHandler keyAction;
-    protected boolean numpadDirections = true, ignoreInput = false;
-    protected SquidMouse mouse;
-    protected final CharArray queue = new CharArray();
-    protected final CharArray processingQueue = new CharArray();
-
-    /**
-     * Constructs a new SquidInput that does not respond to keyboard or mouse input. These can be set later by calling
-     * setKeyHandler() to allow keyboard handling or setMouse() to allow mouse handling on a grid.
-     */
-    public SquidInput() {
-        keyAction = null;
-        mouse = new SquidMouse(12, 12, new InputAdapter());
-    }
-
-    /**
-     * Constructs a new SquidInput that does not respond to keyboard input, but does take mouse input and passes mouse
-     * events along to the given SquidMouse. The SquidMouse, even though it is an InputProcessor on its own, should not
-     * be registered by calling Input.setInputProcessor(SquidMouse), and instead this object should be registered by
-     * calling Input.setInputProcessor(SquidInput). The keyboard and mouse handling can be changed later by calling
-     * setKeyHandler() to allow keyboard handling or setMouse() to change mouse handling.
-     * @param mouse a SquidMouse instance that will be used for handling mouse input. Must not be null.
-     */
-    public SquidInput(SquidMouse mouse) {
-        keyAction = null;
-        this.mouse = mouse;
-    }
-
-
-    /**
-     * Constructs a new SquidInput that does not respond to mouse input, but does take keyboard input and sends keyboard
-     * events through some processing before calling keyHandler.handle() on keypresses that can sensibly be processed.
-     * Modifier keys do not go through the same processing but are checked for their current state when the key is
-     * pressed, and the states of alt, ctrl, and shift are passed to keyHandler.handle() as well.
-     * You can use setMouse() to allow mouse handling or change the KeyHandler with setKeyHandler().
-     * @param keyHandler must implement the SquidInput.KeyHandler interface so it can handle() key input.
-     */
-    public SquidInput(KeyHandler keyHandler) {
-        keyAction = keyHandler;
-        mouse = new SquidMouse(12, 12, new InputAdapter());
-    }
-    /**
-     * Constructs a new SquidInput that does not respond to mouse input, but does take keyboard input and sends keyboard
-     * events through some processing before calling keyHandler.handle() on keypresses that can sensibly be processed.
-     * Modifier keys do not go through the same processing but are checked for their current state when the key is
-     * pressed, and the states of alt, ctrl, and shift are passed to keyHandler.handle() as well.
-     * You can use setMouse() to allow mouse handling or change the KeyHandler with setKeyHandler().
-     * @param keyHandler must implement the SquidInput.KeyHandler interface so it can handle() key input.
-     * @param ignoreInput true if this should ignore input initially, false if it should process input normally.
-     */
-    public SquidInput(KeyHandler keyHandler, boolean ignoreInput) {
-        keyAction = keyHandler;
-        mouse = new SquidMouse(12, 12, new InputAdapter());
-        this.ignoreInput = ignoreInput;
-    }
-    /**
-     * Constructs a new SquidInput that responds to mouse and keyboard input when given a SquidMouse and a
-     * SquidInput.KeyHandler implementation. It sends keyboard events through some processing before calling
-     * keyHandler.handle() on keypresses that can sensibly be processed. Modifier keys do not go through the same
-     * processing but are checked for their current state when the key is pressed, and the states of alt, ctrl, and
-     * shift are passed to keyHandler.handle() as well. The SquidMouse, even though it is an
-     * InputProcessor on its own, should not be registered by calling Input.setInputProcessor(SquidMouse), and instead
-     * this object should be registered by calling Input.setInputProcessor(SquidInput). You can use setKeyHandler() or
-     * setMouse() to change keyboard or mouse handling.
-     * @param keyHandler must implement the SquidInput.KeyHandler interface so it can handle() key input.
-     * @param mouse a SquidMouse instance that will be used for handling mouse input. Must not be null.
-     */
-    public SquidInput(KeyHandler keyHandler, SquidMouse mouse) {
-        keyAction = keyHandler;
-        this.mouse = mouse;
-    }
-
-    /**
-     * Constructs a new SquidInput that responds to mouse and keyboard input when given a SquidMouse and a
-     * SquidInput.KeyHandler implementation, and can be put in an initial state where it ignores input until told
-     * otherwise via setIgnoreInput(boolean). It sends keyboard events through some processing before calling
-     * keyHandler.handle() on keypresses that can sensibly be processed. Modifier keys do not go through the same
-     * processing but are checked for their current state when the key is pressed, and the states of alt, ctrl, and
-     * shift are passed to keyHandler.handle() as well. The SquidMouse, even though it is an
-     * InputProcessor on its own, should not be registered by calling Input.setInputProcessor(SquidMouse), and instead
-     * this object should be registered by calling Input.setInputProcessor(SquidInput). You can use setKeyHandler() or
-     * setMouse() to change keyboard or mouse handling.
-     * @param keyHandler must implement the SquidInput.KeyHandler interface so it can handle() key input.
-     * @param mouse a SquidMouse instance that will be used for handling mouse input. Must not be null.
-     * @param ignoreInput true if this should ignore input initially, false if it should process input normally.
-     */
-    public SquidInput(KeyHandler keyHandler, SquidMouse mouse, boolean ignoreInput) {
-        keyAction = keyHandler;
-        this.mouse = mouse;
-        this.ignoreInput = ignoreInput;
-    }
-
-    public void setKeyHandler(KeyHandler keyHandler)
-    {
-        keyAction = keyHandler;
-    }
-    public void setMouse(SquidMouse mouse)
-    {
-        this.mouse = mouse;
-    }
-
-    public boolean isUsingNumpadDirections() {
-        return numpadDirections;
-    }
-
-    public void setUsingNumpadDirections(boolean using) {
-        numpadDirections = using;
-    }
-
-    public KeyHandler getKeyHandler() {
-        return keyAction;
-    }
-
-    public SquidMouse getMouse() {
-        return mouse;
-    }
-
-    /**
-     * Get the status for whether this should ignore input right now or not. True means this object will ignore and not
-     * queue input, false means it should process them normally. Useful to pause processing or delegate it to
-     * another object temporarily.
-     * @return true if this object currently ignores input, false otherwise.
-     */
-    public boolean getIgnoreInput() {
-        return ignoreInput;
-    }
-
-    /**
-     * Set the status for whether this should ignore input right now or not. True means this object will ignore and not
-     * queue input, false means it should process them normally. Useful to pause processing or delegate it to
-     * another object temporarily.
-     * @param ignoreInput true if this should object should ignore and not queue input, false otherwise.
-     */
-    public void setIgnoreInput(boolean ignoreInput) {
-        this.ignoreInput = ignoreInput;
-    }
-
-    /**
-     * Processes all events queued up, passing them through this object's key processing and then to keyHandler. Mouse
-     * events are not queued and are processed when they come in.
-     */
-    public void drain () {
-        CharArray q = processingQueue;
-
-        if (keyAction == null || queue.size < 2) {
-            queue.clear();
-            return;
-        }
-        q.addAll(queue);
-        queue.clear();
-
-        for (int i = 0, n = q.size; i < n; ) {
-            char c = q.get(i++), mods = q.get(i++);
-            keyAction.handle(c, (mods & 1) != 0, (mods & 2) != 0, (mods & 4) != 0);
-        }
-        /**
-         case KEY_UP:
-         keyProcessor.keyUp(q.get(i++));
-         break;
-         */
-
-        q.clear();
-    }
-
-    /**
-     * Returns true if at least one event is queued.
-     * @return true if there is an event queued, false otherwise.
-     */
-    public boolean hasNext()
-    {
-        return queue.size >= 2;
-    }
-
-    /**
-     * Processes the first key event queued up, passing it to this object's InputProcessor. Mouse events are not
-     * queued and are processed when they come in.
-     */
-    public void next() {
-        CharArray q = processingQueue;
-        if (keyAction == null || queue.size < 2) {
-            queue.clear();
-            return;
-        }
-        q.addAll(queue, 0, 2);
-        queue.removeRange(0, 1);
-
-        if (q.size >= 2) {
-            char c = q.get(0), mods = q.get(1);
-            keyAction.handle(c, (mods & 1) != 0, (mods & 2) != 0, (mods & 4) != 0);
-        }
-        q.clear();
-    }
-
-    /**
-     * Empties the backing queue of data.
-     */
-    public void flush()
-    {
-        queue.clear();
-    }
-
-    @Override
-	public boolean keyDown (int keycode) {
-        if(ignoreInput) return false;
-        boolean alt =  Gdx.input.isKeyPressed(Input.Keys.ALT_LEFT) || Gdx.input.isKeyPressed(Input.Keys.ALT_RIGHT),
-                ctrl =  Gdx.input.isKeyPressed(Input.Keys.CONTROL_LEFT) || Gdx.input.isKeyPressed(Input.Keys.CONTROL_RIGHT),
-                shift = Gdx.input.isKeyPressed(Input.Keys.SHIFT_LEFT) || Gdx.input.isKeyPressed(Input.Keys.SHIFT_RIGHT);
-        char c = fromCode(keycode, shift);
-        char mods = 0;
-        if(c != '\0') {
-            queue.add(c);
-            mods |= (alt) ? 1 : 0;
-            mods |= (ctrl) ? 2 : 0;
-            mods |= (shift) ? 4 : 0;
-            queue.add(mods);
-        }
-        return false;
-    }
-
-    @Override
-	public boolean keyUp (int keycode) {
-//        queue.add(KEY_UP);
-//        queue.add(keycode);
-        return false;
-    }
-
-    @Override
-	public boolean keyTyped (char character) {
-        return false;
-    }
-
-    @Override
-	public boolean touchDown (int screenX, int screenY, int pointer, int button) {
-        if(ignoreInput) return false;
-        return mouse.touchDown(screenX, screenY, pointer, button);
-    }
-
-    @Override
-	public boolean touchUp (int screenX, int screenY, int pointer, int button) {
-        if(ignoreInput) return false;
-        return mouse.touchUp(screenX, screenY, pointer, button);
-    }
-
-    @Override
-	public boolean touchDragged (int screenX, int screenY, int pointer) {
-        if(ignoreInput) return false;
-        return mouse.touchDragged(screenX, screenY, pointer);
-    }
-
-    @Override
-	public boolean mouseMoved (int screenX, int screenY) {
-        if(ignoreInput) return false;
-        return mouse.mouseMoved(screenX, screenY);
-    }
-
-    @Override
-	public boolean scrolled (int amount) {
-        if(ignoreInput) return false;
-        return mouse.scrolled(amount);
-    }
-
-    /**
-     * Maps keycodes to unicode chars, sometimes depending on whether the Shift key is held.
-     *
-     * It is strongly recommended that you refer to key combinations regarding non-alphabet keys by using, for example,
-     * Ctrl-Shift-; instead of Ctrl-:, that is to use the unshifted key with Shift instead of assuming that all
-     * keyboards will use the QWERTY layout. Pressing shift while pressing just about any representable symbol will map
-     * to the shifted version as if on a QWERTY keyboard, and if you don't have a QWERTY keyboard, the mappings are
-     * documented in full below.
-     *
-     * Keys 'a' to 'z' report 'A' to 'Z' when shift is held. Non-Latin characters are not supported, since most
-     * keyboards would be unable to send keys for a particular language and A-Z are very common.
-     *
-     * Top row numbers map as follows:
-     *
-     * '1' to '!', '2' to '@', '3' to '#', '4' to '$', '5' to '%',
-     * '6' to '^', '7' to '&amp;', '8' to '*', '9' to '(', '0' to ')'
-     *
-     * Numpad numbers will report a SquidInput constant such as UP_LEFT_ARROW for Numpad 7, but only if numpadDirections
-     * is true; otherwise they send the number (here, 7). Numpad 0 sends VERTICAL_ARROW or 0.
-     *
-     * Most symbol keys are mapped to a single unicode char as a constant in SquidInput and disregard Shift. The
-     * constant is usually the same as the name of the char; possible exceptions are Backspace (on PC) or Delete (on
-     * Mac) mapping to BACKSPACE, Delete (on PC) mapping to FORWARD_DELETE, Esc mapping to ESCAPE, and Enter (on PC) or
-     * Return (on Mac) mapping to ENTER.
-     *
-     * ':', '*', '#', '@', and space keys, if present, always map to themselves, regardless of Shift.
-     *
-     * Other characters map as follows when Shift is held, as they would on a QWERTY keyboard:
-     *
-     * ',' to '&lt;'
-     *
-     * '.' to '&gt;'
-     *
-     * '/' to '?'
-     *
-     * ';' to ':'
-     *
-     * '\'' to '&quot;'
-     *
-     * '[' to '{'
-     *
-     * ']' to '}'
-     *
-     * '|' to '\\'
-     *
-     * '-' to '_'
-     *
-     * '+' to '='
-     *
-     * '`' to '~'
-     *
-     * @param keycode a keycode as passed by LibGDX
-     * @param shift true if Shift key is being held.
-     * @return a char appropriate to the given keycode; often uses shift to capitalize or change a char, but not for keys like the arrow keys that normally don't produce chars
-     */
-    public char fromCode(int keycode, boolean shift)
-    {
-        switch (keycode) {
-            case Input.Keys.HOME:
-                return HOME;
-            case Input.Keys.FORWARD_DEL:
-                return FORWARD_DELETE;
-            case Input.Keys.ESCAPE:
-                return ESCAPE;
-            case Input.Keys.END:
-                return END;
-
-            case Input.Keys.UP:
-                return UP_ARROW;
-            case Input.Keys.DOWN:
-                return DOWN_ARROW;
-            case Input.Keys.LEFT:
-                return LEFT_ARROW;
-            case Input.Keys.RIGHT:
-                return RIGHT_ARROW;
-            case Input.Keys.CENTER:
-                return CENTER_ARROW;
-
-            case Input.Keys.NUM_0:
-                return (shift) ? ')' : '0';
-            case Input.Keys.NUM_1:
-                return (shift) ? '!' : '1';
-            case Input.Keys.NUM_2:
-                return (shift) ? '@' : '2';
-            case Input.Keys.NUM_3:
-                return (shift) ? '#' : '3';
-            case Input.Keys.NUM_4:
-                return (shift) ? '$' : '4';
-            case Input.Keys.NUM_5:
-                return (shift) ? '%' : '5';
-            case Input.Keys.NUM_6:
-                return (shift) ? '^' : '6';
-            case Input.Keys.NUM_7:
-                return (shift) ? '&' : '7';
-            case Input.Keys.NUM_8:
-                return (shift) ? '*' : '8';
-            case Input.Keys.NUM_9:
-                return (shift) ? '(' : '9';
-            case Input.Keys.NUMPAD_0:
-                return (numpadDirections) ? VERTICAL_ARROW : '0';
-            case Input.Keys.NUMPAD_1:
-                return (numpadDirections) ? DOWN_LEFT_ARROW : '1';
-            case Input.Keys.NUMPAD_2:
-                return (numpadDirections) ? DOWN_ARROW : '2';
-            case Input.Keys.NUMPAD_3:
-                return (numpadDirections) ? DOWN_RIGHT_ARROW : '3';
-            case Input.Keys.NUMPAD_4:
-                return (numpadDirections) ? LEFT_ARROW : '4';
-            case Input.Keys.NUMPAD_5:
-                return (numpadDirections) ? CENTER_ARROW : '5';
-            case Input.Keys.NUMPAD_6:
-                return (numpadDirections) ? RIGHT_ARROW : '6';
-            case Input.Keys.NUMPAD_7:
-                return (numpadDirections) ? UP_LEFT_ARROW : '7';
-            case Input.Keys.NUMPAD_8:
-                return (numpadDirections) ? UP_ARROW : '8';
-            case Input.Keys.NUMPAD_9:
-                return (numpadDirections) ? UP_RIGHT_ARROW : '9';
-            case Input.Keys.COLON:
-                return ':';
-            case Input.Keys.STAR:
-                return '*';
-            case Input.Keys.POUND:
-                return '#';
-            case Input.Keys.A:
-                return (shift) ? 'A' : 'a';
-            case Input.Keys.B:
-                return (shift) ? 'B' : 'b';
-            case Input.Keys.C:
-                return (shift) ? 'C' : 'c';
-            case Input.Keys.D:
-                return (shift) ? 'D' : 'd';
-            case Input.Keys.E:
-                return (shift) ? 'E' : 'e';
-            case Input.Keys.F:
-                return (shift) ? 'F' : 'f';
-            case Input.Keys.G:
-                return (shift) ? 'G' : 'g';
-            case Input.Keys.H:
-                return (shift) ? 'H' : 'h';
-            case Input.Keys.I:
-                return (shift) ? 'I' : 'i';
-            case Input.Keys.J:
-                return (shift) ? 'J' : 'j';
-            case Input.Keys.K:
-                return (shift) ? 'K' : 'k';
-            case Input.Keys.L:
-                return (shift) ? 'L' : 'l';
-            case Input.Keys.M:
-                return (shift) ? 'M' : 'm';
-            case Input.Keys.N:
-                return (shift) ? 'N' : 'n';
-            case Input.Keys.O:
-                return (shift) ? 'O' : 'o';
-            case Input.Keys.P:
-                return (shift) ? 'P' : 'p';
-            case Input.Keys.Q:
-                return (shift) ? 'Q' : 'q';
-            case Input.Keys.R:
-                return (shift) ? 'R' : 'r';
-            case Input.Keys.S:
-                return (shift) ? 'S' : 's';
-            case Input.Keys.T:
-                return (shift) ? 'T' : 't';
-            case Input.Keys.U:
-                return (shift) ? 'U' : 'u';
-            case Input.Keys.V:
-                return (shift) ? 'V' : 'v';
-            case Input.Keys.W:
-                return (shift) ? 'W' : 'w';
-            case Input.Keys.X:
-                return (shift) ? 'X' : 'x';
-            case Input.Keys.Y:
-                return (shift) ? 'Y' : 'y';
-            case Input.Keys.Z:
-                return (shift) ? 'Z' : 'z';
-            case Input.Keys.COMMA:
-                return (shift) ? '<' : ',';
-            case Input.Keys.PERIOD:
-                return (shift) ? '>' :'.';
-            case Input.Keys.TAB:
-                return TAB;
-            case Input.Keys.SPACE:
-                return ' ';
-            case Input.Keys.ENTER:
-                return ENTER;
-            case Input.Keys.BACKSPACE:
-                return BACKSPACE; // also DEL
-            case Input.Keys.GRAVE:
-                return (shift) ? '~' : '`';
-            case Input.Keys.MINUS:
-                return (shift) ? '_' : '-';
-            case Input.Keys.EQUALS:
-                return (shift) ? '+' :'=';
-            case Input.Keys.LEFT_BRACKET:
-                return (shift) ? '{' :'[';
-            case Input.Keys.RIGHT_BRACKET:
-                return (shift) ? '}' :']';
-            case Input.Keys.BACKSLASH:
-                return (shift) ? '|' :'\\';
-            case Input.Keys.SEMICOLON:
-                return (shift) ? ':' :';';
-            case Input.Keys.APOSTROPHE:
-                return (shift) ? '"' :'\'';
-            case Input.Keys.SLASH:
-                return (shift) ? '?' :'/';
-            case Input.Keys.AT:
-                return '@';
-            case Input.Keys.PAGE_UP:
-                return PAGE_UP;
-            case Input.Keys.PAGE_DOWN:
-                return PAGE_DOWN;
-            case Input.Keys.BUTTON_A:
-                return GAMEPAD_A;
-            case Input.Keys.BUTTON_B:
-                return GAMEPAD_B;
-            case Input.Keys.BUTTON_C:
-                return GAMEPAD_C;
-            case Input.Keys.BUTTON_X:
-                return GAMEPAD_X;
-            case Input.Keys.BUTTON_Y:
-                return GAMEPAD_Y;
-            case Input.Keys.BUTTON_Z:
-                return GAMEPAD_Z;
-            case Input.Keys.BUTTON_L1:
-                return GAMEPAD_L1;
-            case Input.Keys.BUTTON_R1:
-                return GAMEPAD_R1;
-            case Input.Keys.BUTTON_L2:
-                return GAMEPAD_L2;
-            case Input.Keys.BUTTON_R2:
-                return GAMEPAD_R2;
-            case Input.Keys.BUTTON_THUMBL:
-                return GAMEPAD_LEFT_THUMB;
-            case Input.Keys.BUTTON_THUMBR:
-                return GAMEPAD_RIGHT_THUMB;
-            case Input.Keys.BUTTON_START:
-                return GAMEPAD_START;
-            case Input.Keys.BUTTON_SELECT:
-                return GAMEPAD_SELECT;
-            case Input.Keys.INSERT:
-                return INSERT;
-
-            case Input.Keys.F1:
-                return F1;
-            case Input.Keys.F2:
-                return F2;
-            case Input.Keys.F3:
-                return F3;
-            case Input.Keys.F4:
-                return F4;
-            case Input.Keys.F5:
-                return F5;
-            case Input.Keys.F6:
-                return F6;
-            case Input.Keys.F7:
-                return F7;
-            case Input.Keys.F8:
-                return F8;
-            case Input.Keys.F9:
-                return F9;
-            case Input.Keys.F10:
-                return F10;
-            case Input.Keys.F11:
-                return F11;
-            case Input.Keys.F12:
-                return F12;
-            default:
-                return '\0';
-        }
-
-    }
-
-    /**
-     * Left arrow key. If numpadDirections is enabled, this will also be sent by Numpad 4.
-     */
-    public static final char LEFT_ARROW = '\u2190';
-    /**
-     * Up arrow key. If numpadDirections is enabled, this will also be sent by Numpad 8.
-     */
-    public static final char UP_ARROW = '\u2191';
-    /**
-     * Down arrow key. If numpadDirections is enabled, this will also be sent by Numpad 6.
-     */
-    public static final char RIGHT_ARROW = '\u2192';
-    /**
-     * Down arrow key. If numpadDirections is enabled, this will also be sent by Numpad 2.
-     */
-    public static final char DOWN_ARROW = '\u2193';
-    /**
-     * Not typically a dedicated key, but if numpadDirections is enabled, this will be sent by Numpad 1.
-     */
-    public static final char DOWN_LEFT_ARROW = '\u2199';
-    /**
-     * Not typically a dedicated key, but if numpadDirections is enabled, this will be sent by Numpad 3.
-     */
-    public static final char DOWN_RIGHT_ARROW = '\u2198';
-    /**
-     * Not typically a dedicated key, but if numpadDirections is enabled, this will be sent by Numpad 9.
-     */
-    public static final char UP_RIGHT_ARROW = '\u2197';
-    /**
-     * Not typically a dedicated key, but if numpadDirections is enabled, this will be sent by Numpad 7.
-     */
-    public static final char UP_LEFT_ARROW = '\u2196';
-    /**
-     * Not typically a dedicated key, but if numpadDirections is enabled, this will be sent by Numpad 5.
-     */
-    public static final char CENTER_ARROW = '\u21BA';
-    /**
-     * Not typically a dedicated key, but if numpadDirections is enabled, this will be sent by Numpad 0.
-     *
-     * Intended for games that might need up a jump or crouch button on the numpad that supplants movement.
-     */
-    public static final char VERTICAL_ARROW = '\u2195';
-    /**
-     * Enter key, also called Return key. Used to start a new line of text or confirm entries in forms.
-     */
-    public static final char ENTER = '\u21B5';
-    /**
-     * Tab key. Used for entering horizontal spacing, such as indentation, but also often to cycle between menu items.
-     */
-    public static final char TAB = '\u21B9';
-    /**
-     * Backspace key on most PC keyboards; Delete key on Mac keyboards. Used to delete the previous character.
-     */
-    public static final char BACKSPACE = '\u2280';
-    /**
-     * Delete key on most PC keyboards; no equivalent on some (all?) Mac keyboards. Used to delete the next character.
-     *
-     * Not present on some laptop keyboards and some (all?) Mac keyboards.
-     */
-    public static final char FORWARD_DELETE = '\u2281';
-    /**
-     * Insert key. Not recommended for common use because it could affect other application behavior.
-     *
-     * Not present on some laptop keyboards.
-     */
-    public static final char INSERT = '\u2208';
-    /**
-     * Page Down key.
-     *
-     * Not present on some laptop keyboards.
-     */
-    public static final char PAGE_DOWN = '\u22A4';
-    /**
-     * Page Up key.
-     *
-     * Not present on some laptop keyboards.
-     */
-    public static final char PAGE_UP = '\u22A5';
-    /**
-     * Home key (commonly used for moving a cursor to start of line).
-     *
-     * Not present on some laptop keyboards.
-     */
-    public static final char HOME = '\u2302';
-    /**
-     * End key (commonly used for moving a cursor to end of line).
-     *
-     * Not present on some laptop keyboards.
-     */
-    public static final char END = '\u2623';
-    /**
-     * Esc or Escape key
-     */
-    public static final char ESCAPE = '\u2620';
-
-    /**
-     * Function key F1
-     */
-    public static final char F1 = '\u2460';
-    /**
-     * Function key F2
-     */
-    public static final char F2 = '\u2461';
-    /**
-     * Function key F3
-     */
-    public static final char F3 = '\u2462';
-    /**
-     * Function key F4
-     */
-    public static final char F4 = '\u2463';
-    /**
-     * Function key F5
-     */
-    public static final char F5 = '\u2464';
-    /**
-     * Function key F6
-     */
-    public static final char F6 = '\u2465';
-    /**
-     * Function key F7
-     */
-    public static final char F7 = '\u2466';
-    /**
-     * Function key F8
-     */
-    public static final char F8 = '\u2467';
-    /**
-     * Function key F9
-     */
-    public static final char F9 = '\u2468';
-    /**
-     * Function key F10
-     */
-    public static final char F10 = '\u2469';
-    /**
-     * Function key F11
-     */
-    public static final char F11 = '\u246A';
-    /**
-     * Function key F12
-     */
-    public static final char F12 = '\u246B';
-
-    /**
-     * Gamepad A button.
-     */
-    public static final char GAMEPAD_A = '\u24b6';
-    /**
-     * Gamepad B button.
-     */
-    public static final char GAMEPAD_B = '\u24b7';
-    /**
-     * Gamepad C button.
-     */
-    public static final char GAMEPAD_C = '\u24b8';
-    /**
-     * Gamepad X button.
-     */
-    public static final char GAMEPAD_X = '\u24cd';
-    /**
-     * Gamepad Y button.
-     */
-    public static final char GAMEPAD_Y = '\u24ce';
-    /**
-     * Gamepad Z button.
-     */
-    public static final char GAMEPAD_Z = '\u24cf';
-
-    /**
-     * Gamepad L1 button.
-     */
-    public static final char GAMEPAD_L1 = '\u24c1';
-    /**
-     * Gamepad L2 button.
-     */
-    public static final char GAMEPAD_L2 = '\u24db';
-    /**
-     * Gamepad R1 button.
-     */
-    public static final char GAMEPAD_R1 = '\u24c7';
-    /**
-     * Gamepad R2 button.
-     */
-    public static final char GAMEPAD_R2 = '\u24e1';
-    /**
-     * Gamepad Left Thumb button.
-     */
-    public static final char GAMEPAD_LEFT_THUMB = '\u24a7';
-    /**
-     * Gamepad Right Thumb button.
-     */
-    public static final char GAMEPAD_RIGHT_THUMB = '\u24ad';
-    /**
-     * Gamepad Start button.
-     */
-    public static final char GAMEPAD_START = '\u2713';
-    /**
-     * Gamepad Select button.
-     */
-    public static final char GAMEPAD_SELECT = '\u261C';
-
-
-}

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 1505
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/SquidLayers.java


+ 0 - 260
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/SquidMessageBox.java

@@ -1,260 +0,0 @@
-package squidpony.squidgrid.gui.gdx;
-
-import com.badlogic.gdx.Gdx;
-import com.badlogic.gdx.graphics.Color;
-import com.badlogic.gdx.graphics.g2d.Batch;
-import com.badlogic.gdx.scenes.scene2d.InputEvent;
-import com.badlogic.gdx.scenes.scene2d.InputListener;
-import com.badlogic.gdx.scenes.scene2d.ui.Label;
-import squidpony.IColorCenter;
-import squidpony.panel.IColoredString;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A specialized SquidPanel that is meant for displaying messages in a scrolling pane. You primarily use this class by
- * calling appendMessage() or appendWrappingMessage(), but the full SquidPanel API is available as well, though it isn't
- * the best idea to use that set of methods with this class in many cases. Messages can be Strings or IColoredStrings.
- * Height must be at least 3 cells, because clicking/tapping the top or bottom borders (which are part of the grid's
- * height, which leaves 1 row in the middle for a message) will scroll up or down.
- * Created by Tommy Ettinger on 12/10/2015.
- * 
- * @see LinesPanel An alternative, which is also designed to write messages (not
- *      in a scrolling pane though), but which is backed up by {@link com.badlogic.gdx.scenes.scene2d.Actor}
- *      instead of {@link SquidPanel} (hence better supports tight variable-width fonts)
- */
-public class SquidMessageBox extends SquidPanel {
-    protected ArrayList<IColoredString<Color>> messages = new ArrayList<>(256);
-    protected ArrayList<Label> labels = new ArrayList<>(256);
-    protected int messageIndex = 0;
-    //private static Pattern lineWrapper;
-    private char[][] basicBorders;
-    /**
-     * Creates a bare-bones panel with all default values for text rendering.
-     *
-     * @param gridWidth  the number of cells horizontally
-     * @param gridHeight the number of cells vertically, must be at least 3
-     */
-    public SquidMessageBox(int gridWidth, int gridHeight) {
-        super(gridWidth, gridHeight);
-        if(gridHeight < 3)
-            throw new IllegalArgumentException("gridHeight must be at least 3, was given: " + gridHeight);
-        basicBorders = assembleBorders();
-        appendMessage("");
-        //lineWrapper = Pattern.compile(".{1," + (gridWidth - 2) + "}(\\s|-|$)+");
-    }
-
-    /**
-     * Creates a panel with the given grid and cell size. Uses a default square font.
-     *
-     * @param gridWidth  the number of cells horizontally
-     * @param gridHeight the number of cells vertically
-     * @param cellWidth  the number of horizontal pixels in each cell
-     * @param cellHeight the number of vertical pixels in each cell
-     */
-    public SquidMessageBox(int gridWidth, int gridHeight, int cellWidth, int cellHeight) {
-        super(gridWidth, gridHeight, cellWidth, cellHeight);
-        if(gridHeight < 3)
-            throw new IllegalArgumentException("gridHeight must be at least 3, was given: " + gridHeight);
-        basicBorders = assembleBorders();
-        appendMessage("");
-        //lineWrapper = Pattern.compile(".{1," + (gridWidth - 2) + "}(\\s|-|$)+");
-    }
-
-    /**
-     * Builds a panel with the given grid size and all other parameters determined by the factory. Even if sprite images
-     * are being used, a TextCellFactory is still needed to perform sizing and other utility functions.
-     * <p/>
-     * If the TextCellFactory has not yet been initialized, then it will be sized at 12x12 px per cell. If it is null
-     * then a default one will be created and initialized.
-     *
-     * @param gridWidth  the number of cells horizontally
-     * @param gridHeight the number of cells vertically
-     * @param factory    the factory to use for cell rendering
-     */
-    public SquidMessageBox(int gridWidth, int gridHeight, TextCellFactory factory) {
-        super(gridWidth, gridHeight, factory);
-        if(gridHeight < 3)
-            throw new IllegalArgumentException("gridHeight must be at least 3, was given: " + gridHeight);
-        basicBorders = assembleBorders();
-        appendMessage("");
-        //lineWrapper = Pattern.compile(".{1," + (gridWidth - 2) + "}(\\s|-|$)+");
-    }
-
-    /**
-     * Builds a panel with the given grid size and all other parameters determined by the factory. Even if sprite images
-     * are being used, a TextCellFactory is still needed to perform sizing and other utility functions.
-     * <p/>
-     * If the TextCellFactory has not yet been initialized, then it will be sized at 12x12 px per cell. If it is null
-     * then a default one will be created and initialized.
-     *
-     * @param gridWidth  the number of cells horizontally
-     * @param gridHeight the number of cells vertically
-     * @param factory    the factory to use for cell rendering
-     * @param center     The color center to use. Can be {@code null}, but then must be set later on with
-     *                   {@link #setColorCenter(IColorCenter)}.
-     */
-    public SquidMessageBox(int gridWidth, int gridHeight, final TextCellFactory factory, IColorCenter<Color> center) {
-        super(gridWidth, gridHeight, factory, center);
-        if(gridHeight < 3)
-            throw new IllegalArgumentException("gridHeight must be at least 3, was given: " + gridHeight);
-        basicBorders = assembleBorders();
-        appendMessage("");
-        //lineWrapper = Pattern.compile(".{1," + (gridWidth - 2) + "}(\\s|-|$)+");
-
-    }
-    private void makeBordersClickable()
-    {
-        final float cellH = getHeight() / gridHeight;
-        clearListeners();
-        addListener(new InputListener(){
-            @Override
-			public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
-                if(x >= 0 && x < getWidth())
-                {
-                    if(y < cellH)
-                    {
-                        nudgeDown();
-                        return true;
-                    }
-                    else if(y >= getHeight() - cellH * 2)
-                    {
-                        nudgeUp();
-                        return true;
-                    }
-                }
-                return false;
-            }
-        });
-    }
-
-    /**
-     * The primary way of using this class. Appends a new line to the message listing and scrolls to the bottom.
-     * @param message a String that should be no longer than gridWidth - 2; will be truncated otherwise.
-     */
-    public void appendMessage(String message)
-    {
-        IColoredString.Impl<Color> truncated = new IColoredString.Impl<>(message, defaultForeground);
-        truncated.setLength(gridWidth - 2);
-        messages.add(truncated);
-        messageIndex = messages.size() - 1;
-    }
-    /**
-     * Appends a new line to the message listing and scrolls to the bottom. If the message cannot fit on one line,
-     * it will be word-wrapped and one or more messages will be appended after it.
-     * @param message a String; this method has no specific length restrictions
-     */
-    public void appendWrappingMessage(String message)
-    {
-        if(message.length() <= gridWidth - 2)
-        {
-            appendMessage(message);
-            return;
-        }
-        List<IColoredString<Color>> truncated = new IColoredString.Impl<>(message, defaultForeground).wrap(gridWidth - 2);
-        for (IColoredString<Color> t : truncated)
-        {
-            appendMessage(t.present());
-        }
-        messageIndex = messages.size() - 1;
-    }
-
-    /**
-     * A common way of using this class. Appends a new line as an IColoredString to the message listing and scrolls to
-     * the bottom.
-     * @param message an IColoredString that should be no longer than gridWidth - 2; will be truncated otherwise.
-     */
-    public void appendMessage(IColoredString<Color> message)
-    {
-        IColoredString.Impl<Color> truncated = new IColoredString.Impl<>();
-        truncated.append(message);
-        truncated.setLength(gridWidth - 2);
-        messageIndex = messages.size() - 1;
-    }
-
-    /**
-     * Appends a new line as an IColoredString to the message listing and scrolls to the bottom. If the message cannot
-     * fit on one line, it will be word-wrapped and one or more messages will be appended after it.
-     * @param message an IColoredString with type parameter Color; this method has no specific length restrictions
-     */
-    public void appendWrappingMessage(IColoredString<Color> message)
-    {
-        if(message.length() <= gridWidth - 2)
-        {
-            appendMessage(message);
-            return;
-        }
-        List<IColoredString<Color>> truncated = message.wrap(gridWidth - 2);
-        for (IColoredString<Color> t : truncated)
-        {
-            appendMessage(t);
-        }
-        messages.addAll(truncated);
-        messageIndex = messages.size() - 1;
-    }
-
-    /**
-     * Used internally to scroll up by one line, but can also be triggered by your code.
-     */
-    public void nudgeUp()
-    {
-        messageIndex = Math.max(0, messageIndex - 1);
-    }
-
-    /**
-     * Used internally to scroll down by one line, but can also be triggered by your code.
-     */
-    public void nudgeDown()
-    {
-        messageIndex = Math.min(messages.size() - 1, messageIndex + 1);
-    }
-    private char[][] assembleBorders() {
-        char[][] result = new char[gridWidth][gridHeight];
-        result[0][0] = '┌';
-        result[gridWidth - 1][0] = '┐';
-        result[0][gridHeight - 1] = '└';
-        result[gridWidth - 1][gridHeight - 1] = '┘';
-        for (int i = 1; i < gridWidth - 1; i++) {
-            result[i][0] = '─';
-            result[i][gridHeight - 1] = '─';
-        }
-        for (int y = 1; y < gridHeight - 1; y++) {
-            result[0][y] = '│';
-            result[gridWidth - 1][y] = '│';
-        }
-        for (int y = 1; y < gridHeight - 1; y++) {
-            for (int x = 1; x < gridWidth - 1; x++) {
-                result[x][y] = ' ';
-                result[x][y] = ' ';
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public void draw(Batch batch, float parentAlpha) {
-        super.draw(batch, parentAlpha);
-        put(basicBorders);
-        for (int i = 1; i < gridHeight - 1 && i <= messageIndex; i++) {
-            put(1, gridHeight - 1 - i, messages.get(messageIndex + 1 - i));
-        }
-        act(Gdx.graphics.getDeltaTime());
-    }
-
-    /**
-     * Set the x, y position of the lower left corner, plus set the width and height.
-     * ACTUALLY NEEDED to make the borders clickable. It can't know
-     * the boundaries of the clickable area until it knows its own position and bounds.
-     *
-     * @param x x position in pixels or other units that libGDX is set to use
-     * @param y y position in pixels or other units that libGDX is set to use
-     * @param width the width in pixels (usually) of the message box; changes on resize
-     * @param height the height in pixels (usually) of the message box; changes on resize
-     */
-    @Override
-    public void setBounds(float x, float y, float width, float height) {
-        super.setBounds(x, y, width, height);
-        makeBordersClickable();
-    }
-}

+ 0 - 204
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/SquidMouse.java

@@ -1,204 +0,0 @@
-package squidpony.squidgrid.gui.gdx;
-
-import com.badlogic.gdx.Gdx;
-import com.badlogic.gdx.InputAdapter;
-import com.badlogic.gdx.InputProcessor;
-import com.badlogic.gdx.math.MathUtils;
-
-/**
- * This mouse processor allows for easy conversion to a grid based system. This
- * class covers all aspects of mouse movement and clicking, passing those off
- * to a given InputProcessor after converting to cell-based grid coordinates
- * instead of pixel-based screen coordinates. It also passes off scroll events
- * to the InputProcessor without additional changes.
- *
- * This class is meant to be used as a wrapper to your own mouse InputProcessor,
- * it simply converts the coordinates from UI Component x,y to Grid based x,y
- *
- * @author Eben Howard - http://squidpony.com - howard@squidpony.com
- * @author Tommy Ettinger
- */
-public class SquidMouse extends InputAdapter {
-
-	protected float cellWidth, cellHeight, gridWidth, gridHeight;
-    protected int  offsetX, offsetY;
-    protected InputProcessor processor;
-
-    /**
-     * Sets the size of the cell so that all mouse input can be evaluated as
-     * relative to the grid. All input is passed to the provided InputProcessor once
-     * it has had its coordinates translated to grid coordinates.
-     *
-     * Offsets are initialized to 0 here, and the grid is assumed to take up the
-     * full game window.
-     *
-     * @param cellWidth
-     * @param cellHeight
-     * @param processor an InputProcessor that implements some of touchUp(), touchDown(), touchDragged(), mouseMoved(), or scrolled().
-     */
-    public SquidMouse(float cellWidth, float cellHeight, InputProcessor processor) {
-        this.cellWidth = cellWidth;
-        this.cellHeight = cellHeight;
-        this.processor = processor;
-        offsetX = 0;
-        offsetY = 0;
-        gridWidth = Gdx.graphics.getWidth() / cellWidth;
-        gridHeight = Gdx.graphics.getHeight() / cellHeight;
-    }
-
-    /**
-     * Sets the size of the cell so that all mouse input can be evaluated as
-     * relative to the grid. Offsets can be specified for x and y if the grid
-     * is displayed at a position other than the full screen. Specify the
-     * width and height in grid cells of the area to receive input, as well as
-     * the offsets from the bottom and left edges also measured in grid cells.
-     * All input is passed to the provided InputProcessor once it's had its
-     * coordinates translated to grid coordinates.
-     *
-     * If the input is not within the bounds of the grid as determined by
-     * gridWidth, gridHeight, offsetX, and offsetY, the input will be clamped.
-     *
-     * @param cellWidth
-     * @param cellHeight
-     * @param gridWidth
-     * @param gridHeight
-     * @param offsetX
-     * @param offsetY
-     * @param processor an InputProcessor that implements some of touchUp(), touchDown(), touchDragged(), mouseMoved(), or scrolled().
-     */
-    public SquidMouse(float cellWidth, float cellHeight, float gridWidth, float gridHeight, int offsetX, int offsetY, InputProcessor processor) {
-        this.cellWidth = cellWidth;
-        this.cellHeight = cellHeight;
-        this.processor = processor;
-        this.offsetX = offsetX;
-        this.offsetY = offsetY;
-        this.gridWidth = gridWidth;
-        this.gridHeight = gridHeight;
-    }
-
-    public float getCellWidth() {
-        return cellWidth;
-    }
-
-    public float getCellHeight() {
-        return cellHeight;
-    }
-
-    public int getOffsetX() {
-        return offsetX;
-    }
-
-    public int getOffsetY() {
-        return offsetY;
-    }
-
-    public float getGridWidth() {
-        return gridWidth;
-    }
-
-    public float getGridHeight() {
-        return gridHeight;
-    }
-
-    public void setCellWidth(float cellWidth) {
-        this.cellWidth = cellWidth;
-    }
-
-    public void setCellHeight(float cellHeight) {
-        this.cellHeight = cellHeight;
-    }
-
-    public void setOffsetX(int offsetX) {
-        this.offsetX = offsetX;
-    }
-
-    public void setOffsetY(int offsetY) {
-        this.offsetY = offsetY;
-    }
-
-    public void setGridWidth(float gridWidth) {
-        this.gridWidth = gridWidth;
-    }
-
-    public void setGridHeight(float gridHeight) {
-        this.gridHeight = gridHeight;
-    }
-
-
-    public void reinitialize(float cellWidth, float cellHeight)
-    {
-        this.cellWidth = cellWidth;
-        this.cellHeight = cellHeight;
-        offsetX = 0;
-        offsetY = 0;
-        gridWidth = Gdx.graphics.getWidth() / cellWidth;
-        gridHeight = Gdx.graphics.getHeight() / cellHeight;
-    }
-    public void reinitialize(float cellWidth, float cellHeight, float gridWidth, float gridHeight, int offsetX, int offsetY)
-    {
-        this.cellWidth = cellWidth;
-        this.cellHeight = cellHeight;
-        this.offsetX = offsetX;
-        this.offsetY = offsetY;
-        this.gridWidth = gridWidth;
-        this.gridHeight = gridHeight;
-    }
-
-    /**
-     * Gets the InputProcessor this object uses to handle mouse input.
-     * @return the wrapped InputProcessor.
-     */
-    public InputProcessor getProcessor() {
-        return processor;
-    }
-
-    /**
-     * Sets the InputProcessor this object uses to handle mouse input.
-     * @param processor an InputProcessor that implements some of touchUp(), touchDown(), touchDragged(), mouseMoved(), or scrolled().
-     */
-    public void setProcessor(InputProcessor processor) {
-        this.processor = processor;
-    }
-
-	protected int translateX(int screenX) {
-		return MathUtils.clamp(MathUtils.floor((screenX + offsetX) / cellWidth), 0, (int)(gridWidth - 1)); //MathUtils.floor((offsetX * 0f) / cellWidth)
-	}
-
-	protected int translateY(int screenY) {
-		return MathUtils.clamp(MathUtils.floor((screenY + offsetY) / cellHeight), 0, (int)(gridHeight - 1)); //MathUtils.floor((offsetY * 0f) / cellHeight)
-	}
-
-    public boolean onGrid(int screenX, int screenY)
-    {
-        int tmp = MathUtils.floor((screenX + offsetX) / cellWidth);
-        if(tmp < 0 || tmp >= gridWidth)
-            return false;
-        tmp = MathUtils.floor((screenY + offsetY) / cellHeight);
-        return tmp >= 0 && tmp < gridHeight;
-    }
-
-    @Override
-    public boolean touchDown(int screenX, int screenY, int pointer, int button) {
-        return processor.touchDown(translateX(screenX), translateY(screenY), pointer, button);
-    }
-
-    @Override
-    public boolean touchUp(int screenX, int screenY, int pointer, int button) {
-        return processor.touchUp(translateX(screenX), translateY(screenY), pointer, button);
-    }
-
-    @Override
-    public boolean touchDragged(int screenX, int screenY, int pointer) {
-        return processor.touchDragged(translateX(screenX), translateY(screenY), pointer);
-    }
-
-    @Override
-    public boolean mouseMoved(int screenX, int screenY) {
-        return processor.mouseMoved(translateX(screenX), translateY(screenY));
-    }
-
-    @Override
-    public boolean scrolled(int amount) {
-        return processor.scrolled(amount);
-    }
-}

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

@@ -526,366 +526,6 @@ public class SquidPanel extends Group implements ISquidPanel<Color> {
         return  null;
     }
 
-    /**
-     * Create an AnimatedEntity at position x, y, using the char c in the given color.
-     * @param x
-     * @param y
-     * @param c
-     * @param color
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, char c, Color color)
-    {
-        return animateActor(x, y, false, String.valueOf(c), color);
-        /*
-        Actor a = textFactory.makeActor("" + c, color);
-        a.setName("" + c);
-        a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-
-        AnimatedEntity ae = new AnimatedEntity(a, x, y);
-        animatedEntities.add(ae);
-        return ae;
-        */
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using the char c in the given color. If doubleWidth is true, treats
-     * the char c as the left char to be placed in a grid of 2-char cells.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param c
-     * @param color
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, char c, Color color)
-    {
-        return animateActor(x, y, doubleWidth, String.valueOf(c), color);
-        /*
-        Actor a = textFactory.makeActor("" + c, color);
-        a.setName("" + c);
-        if(doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-        */
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using the String s in the given color.
-     * @param x
-     * @param y
-     * @param s
-     * @param color
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, String s, Color color)
-    {
-        return animateActor(x, y, false, s, color);
-        /*
-        Actor a = textFactory.makeActor(s, color);
-        a.setName(s);
-        a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-
-        AnimatedEntity ae = new AnimatedEntity(a, x, y);
-        animatedEntities.add(ae);
-        return ae;
-        */
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using the String s in the given color. If doubleWidth is true, treats
-     * the String s as starting in the left cell of a pair to be placed in a grid of 2-char cells.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param s
-     * @param color
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, String s, Color color)
-    {
-        Actor a = textFactory.makeActor(s, color);
-        a.setName(s);
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        /*
-        if(doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        */
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-    /**
-     * Create an AnimatedEntity at position x, y, using the String s in the given color. If doubleWidth is true, treats
-     * the String s as starting in the left cell of a pair to be placed in a grid of 2-char cells.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param s
-     * @param colors
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, String s, Collection<Color> colors)
-    {
-        Actor a = textFactory.makeActor(s, colors);
-        a.setName(s);
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        /*
-        if(doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        */
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-    /**
-     * Create an AnimatedEntity at position x, y, using the String s in the given color. If doubleWidth is true, treats
-     * the String s as starting in the left cell of a pair to be placed in a grid of 2-char cells.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param s
-     * @param colors
-     * @param loopTime
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, String s, Collection<Color> colors, float loopTime)
-    {
-        Actor a = textFactory.makeActor(s, colors, loopTime, doubleWidth);
-        a.setName(s);
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        /*
-        if(doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        */
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-    /**
-     * Create an AnimatedEntity at position x, y, using '^' as its contents, but as an image so it can be rotated.
-     * Uses the given colors in a looping pattern, that doesn't count as an animation. If doubleWidth is true, treats
-     * the '^' as starting in the middle of a 2-char cell.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param colors
-     * @param loopTime
-     * @return
-     */
-    public AnimatedEntity directionMarker(int x, int y, boolean doubleWidth, Collection<Color> colors, float loopTime)
-    {
-        Actor a = textFactory.makeDirectionMarker(colors, loopTime, doubleWidth);
-        a.setName("^");
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-    public AnimatedEntity directionMarker(int x, int y, boolean doubleWidth, Color color)
-    {
-        Actor a = textFactory.makeDirectionMarker(color);
-        a.setName("^");
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-    /**
-     * Create an AnimatedEntity at position x, y, using the char c with a color looked up by index in palette.
-     * @param x
-     * @param y
-     * @param c
-     * @param index
-     * @param palette
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, char c, int index, ArrayList<Color> palette)
-    {
-        return animateActor(x, y, c, palette.get(index));
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using the String s with a color looked up by index in palette.
-     * @param x
-     * @param y
-     * @param s
-     * @param index
-     * @param palette
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, String s, int index, ArrayList<Color> palette)
-    {
-        return animateActor(x, y, s, palette.get(index));
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using a TextureRegion with no color modifications, which will be
-     * stretched to fit one cell.
-     * @param x
-     * @param y
-     * @param texture
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, TextureRegion texture)
-    {
-        return animateActor(x, y, false, texture, Color.WHITE);
-        /*
-        Actor a = textFactory.makeActor(texture, Color.WHITE);
-        a.setName("");
-        a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-
-        AnimatedEntity ae = new AnimatedEntity(a, x, y);
-        animatedEntities.add(ae);
-        return ae;
-        */
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using a TextureRegion with the given color, which will be
-     * stretched to fit one cell.
-     * @param x
-     * @param y
-     * @param texture
-     * @param color
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, TextureRegion texture, Color color)
-    {
-        return animateActor(x, y, false, texture, color);
-        /*
-        Actor a = textFactory.makeActor(texture, color);
-        a.setName("");
-        a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-
-        AnimatedEntity ae = new AnimatedEntity(a, x, y);
-        animatedEntities.add(ae);
-        return ae;
-        */
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using a TextureRegion with no color modifications, which will be
-     * stretched to fit one cell, or two cells if doubleWidth is true.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param texture
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, TextureRegion texture)
-    {
-        return animateActor(x, y, doubleWidth, texture, Color.WHITE);
-        /*
-        Actor a = textFactory.makeActor(texture, Color.WHITE, (doubleWidth ? 2 : 1) * cellWidth, cellHeight);
-
-        a.setName("");
-        if(doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-        */
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using a TextureRegion with the given color, which will be
-     * stretched to fit one cell, or two cells if doubleWidth is true.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param texture
-     * @param color
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, TextureRegion texture, Color color) {
-        Actor a = textFactory.makeActor(texture, color, (doubleWidth ? 2 : 1) * cellWidth, cellHeight);
-        a.setName("");
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        /*
-        if (doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        */
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using a TextureRegion with no color modifications, which, if and only
-     * if stretch is true, will be stretched to fit one cell, or two cells if doubleWidth is true. If stretch is false,
-     * this will preserve the existing size of texture.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param stretch
-     * @param texture
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, boolean stretch, TextureRegion texture)
-    {
-        Actor a = (stretch)
-                ? textFactory.makeActor(texture, Color.WHITE, (doubleWidth ? 2 : 1) * cellWidth, cellHeight)
-                : textFactory.makeActor(texture, Color.WHITE, texture.getRegionWidth(), texture.getRegionHeight());
-        a.setName("");
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        /*
-        if(doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight  - textFactory.getDescent() + getY());
-        */
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-
-    /**
-     * Create an AnimatedEntity at position x, y, using a TextureRegion with the given color, which, if and only
-     * if stretch is true, will be stretched to fit one cell, or two cells if doubleWidth is true. If stretch is false,
-     * this will preserve the existing size of texture.
-     * @param x
-     * @param y
-     * @param doubleWidth
-     * @param stretch
-     * @param texture
-     * @param color
-     * @return
-     */
-    public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, boolean stretch, TextureRegion texture, Color color) {
-
-        Actor a = (stretch)
-                ? textFactory.makeActor(texture, color, (doubleWidth ? 2 : 1) * cellWidth, cellHeight)
-                : textFactory.makeActor(texture, color, texture.getRegionWidth(), texture.getRegionHeight());
-        a.setName("");
-        a.setPosition(adjustX(x, doubleWidth), adjustY(y));
-        /*
-        if (doubleWidth)
-            a.setPosition(x * 2 * cellWidth + getX(), (gridHeight - y - 1) * cellHeight  - textFactory.getDescent() + getY());
-        else
-            a.setPosition(x * cellWidth + getX(), (gridHeight - y - 1) * cellHeight  - textFactory.getDescent() + getY());
-            */
-        AnimatedEntity ae = new AnimatedEntity(a, x, y, doubleWidth);
-        animatedEntities.add(ae);
-        return ae;
-    }
-
     /**
      * Created an Actor from the contents of the given x,y position on the grid.
      * @param x

+ 0 - 103
squidlib/src/main/java/squidpony/squidgrid/gui/gdx/TextCellFactory.java

@@ -1083,109 +1083,6 @@ public class TextCellFactory implements Disposable {
         }
     }
 
-    /**
-     * Converts a String into a ColorChangeLabel, or if the argument s is null, creates a ColorChangeImage of a solid
-     * block. Can be used for preparing glyphs for animation effects, and is used internally for this purpose. The
-     * ColorChange classes will rotate between all colors given in the List each second, and are not affected by setColor,
-     * though they are affected by their setColors methods. Their color change is not considered an animation for the
-     * purposes of things like SquidPanel.hasActiveAnimations() .
-     * @param s a String to make into an Actor, which can be null for a solid block.
-     * @param colors a List of Color to tint s with, looping through all elements in the list each second
-     * @return the Actor, with no position set.
-     */
-    public Actor makeActor(String s, Collection<Color> colors) {
-        return makeActor(s, colors, 2f, false);
-    }
-    /**
-     * Converts a String into a ColorChangeLabel, or if the argument s is null, creates a ColorChangeImage of a solid
-     * block. Can be used for preparing glyphs for animation effects, and is used internally for this purpose. The
-     * ColorChange classes will rotate between all colors given in the List each second, and are not affected by setColor,
-     * though they are affected by their setColors methods. Their color change is not considered an animation for the
-     * purposes of things like SquidPanel.hasActiveAnimations() .
-     * @param s a String to make into an Actor, which can be null for a solid block.
-     * @param colors a List of Color to tint s with, looping through all elements in the list each second
-     * @param loopTime the amount of time, in seconds, to spend looping through all colors in the list
-     * @return the Actor, with no position set.
-     */
-    public Actor makeActor(String s, Collection<Color> colors, float loopTime)
-    {
-        return makeActor(s, colors, loopTime, false);
-    }
-    /**
-     * Converts a String into a ColorChangeLabel, or if the argument s is null, creates a ColorChangeImage of a solid
-     * block. Can be used for preparing glyphs for animation effects, and is used internally for this purpose. The
-     * ColorChange classes will rotate between all colors given in the List each second, and are not affected by setColor,
-     * though they are affected by their setColors methods. Their color change is not considered an animation for the
-     * purposes of things like SquidPanel.hasActiveAnimations() .
-     * @param s a String to make into an Actor, which can be null for a solid block.
-     * @param colors a List of Color to tint s with, looping through all elements in the list each second
-     * @param loopTime the amount of time, in seconds, to spend looping through all colors in the list
-     * @return the Actor, with no position set.
-     */
-    public Actor makeActor(String s, Collection<Color> colors, float loopTime, boolean doubleWidth) {
-        if (!initialized) {
-            throw new IllegalStateException("This factory has not yet been initialized!");
-        }
-        ArrayList<Color> colors2 = null;
-        if(colors != null && !colors.isEmpty())
-        {
-            colors2 = new ArrayList<>(colors.size());
-            for (Color c : colors) {
-                colors2.add(scc.filter(c));
-            }
-        }
-        if (s == null) {
-            ColorChangeImage im = new ColorChangeImage(block, loopTime, doubleWidth, colors2);
-            //im.setSize(width, height - MathUtils.ceil(bmpFont.getDescent() / 2f));
-            im.setSize(actualCellWidth * (doubleWidth ? 2 : 1), actualCellHeight + (distanceField ? 1 : 0)); //  - lineHeight / actualCellHeight //+ lineTweak * 1f
-            // im.setPosition(x - width * 0.5f, y - height * 0.5f, Align.center);
-            return im;
-        } else if(s.length() > 0 && s.charAt(0) == '\0') {
-            ColorChangeImage im = new ColorChangeImage(block, loopTime, doubleWidth, colors2);
-            //im.setSize(width * s.length(), height - MathUtils.ceil(bmpFont.getDescent() / 2f));
-            im.setSize(actualCellWidth * s.length() * (doubleWidth ? 2 : 1), actualCellHeight + (distanceField ? 1 : 0)); //   - lineHeight / actualCellHeight //+ lineTweak * 1f
-            // im.setPosition(x - width * 0.5f, y - height * 0.5f, Align.center);
-            return im;
-        } else {
-            ColorChangeLabel lb;
-            if(swap.containsKey(s))
-                lb = new ColorChangeLabel(swap.get(s), style, loopTime, doubleWidth, colors2);
-            else
-                lb = new ColorChangeLabel(s, style, loopTime, doubleWidth, colors2);
-            lb.setSize(width * s.length(), height - descent); //+ lineTweak * 1f
-            // lb.setPosition(x - width * 0.5f, y - height * 0.5f, Align.center);
-            return lb;
-        }
-    }
-
-    /**
-     * Creates a ColorChangeImage Actor that should look like the glyph '^' in this font, but will be rotate-able. The
-     * ColorChange classes will rotate between all colors given in the List in the given amount of loopTime, and are not
-     * affected by setColor, though they are affected by their setColors methods. Their color change is not considered
-     * an animation for the purposes of things like SquidPanel.hasActiveAnimations() .
-     * @param colors a List of Color to tint s with, looping through all elements in the list each second
-     * @param loopTime the amount of time, in seconds, to spend looping through all colors in the list
-     * @return the Actor, with no position set.
-     */
-    public Actor makeDirectionMarker(Collection<Color> colors, float loopTime, boolean doubleWidth) {
-        if (!initialized) {
-            throw new IllegalStateException("This factory has not yet been initialized!");
-        }
-        ArrayList<Color> colors2 = null;
-        if (colors != null && !colors.isEmpty()) {
-            colors2 = new ArrayList<>(colors.size());
-            for (Color c : colors) {
-                colors2.add(scc.filter(c));
-            }
-        }
-        ColorChangeImage im = new ColorChangeImage(dirMarker, loopTime, doubleWidth,
-                actualCellWidth, actualCellHeight + (distanceField ? 1 : 0), colors2);
-        im.setAlign(2);
-        //im.setSize(width, height - MathUtils.ceil(bmpFont.getDescent() / 2f));
-        im.setSize(actualCellWidth * (doubleWidth ? 2 : 1), actualCellHeight + (distanceField ? 1 : 0)); //  - lineHeight / actualCellHeight //+ lineTweak * 1f
-        // im.setPosition(x - width * 0.5f, y - height * 0.5f, Align.center);
-        return im;
-    }
     /**
      * Creates a Image Actor that should look like the glyph '^' in this font, but will be rotate-able.
      * @param color a Color to tint the '^' with