import java.util.Set;

public class State
{
    public State (Coordinate coord, Set<Character> keys, int steps)
    {
        _coord = coord;
        _keys = keys;
        _steps = steps;
        _id = Util.keycode(keys);
    }

    public Coordinate getPosition ()
    {
        return _coord;
    }

    public int numberOfKeys ()
    {
        return _keys.size();
    }

    public int numberOfSteps ()
    {
        return _steps;
    }

    public boolean hasKey (char door)
    {
        char key = Character.toLowerCase(door);

        return _keys.contains(door);
    }

    public Set<Character> getKeys ()
    {
        return _keys;
    }

    public String getIdentifier ()
    {
        return _id;
    }

    private Coordinate _coord;
    private Set<Character> _keys;
    private int _steps;
    private String _id;
}

@@ -16,16 +16,227 @@
 l.Set;%0A%0A
+/*%0A * Instances of this class are used to record the current%0A * search pattern through the tunnels. We need to remember%0A * the starting point, the keys we've found and the number%0A * of steps to this stage.%0A */%0A%0A
 public c

Update State.java