import java.util.*;

public class Maze
{
    public Maze ()
    {
        _map = new Vector<Tile>();
        _maxX = 0;
        _minX = 0;
        _maxY = 0;
        _minY = 0;
        _oxygenStation = null;
        _startingPoint = null;
    }

    public final void updateTile (Coordinate coord, String type)
    {
        Tile t = new Tile(coord, type);
        int index = _map.indexOf(t);
        
        if ((_startingPoint == null) && (TileId.STARTING_POINT.equals(type)))
            _startingPoint = coord;
        else
        {
            if ((_oxygenStation == null) && (TileId.OXYGEN_STATION.equals(type)))
                _oxygenStation = coord;
        }

        if (index == -1)
        {
            if (coord.getX() > _maxX)
                _maxX = coord.getX();
            else
            {
                if (coord.getX() < _minX)
                    _minX = coord.getX();
            }

            if (coord.getY() > _maxY)
                _maxY = coord.getY();
            else
            {
                if (coord.getY() < _minY)
                    _minY = coord.getY();
            }

            _map.add(t);
        }
        else
            _map.set(index, t);
    }

    public final Coordinate getStartingPoint ()
    {
        return _startingPoint;
    }

    public final Coordinate getOxygenStation ()
    {
        return _oxygenStation;
    }

    public final boolean isWall (Coordinate coord)
    {
        return tileType(coord).equals(TileId.WALL);
    }

    public final boolean isUnexplored (Coordinate coord)
    {
        return tileType(coord).equals(TileId.UNEXPLORED);
    }
    
    public final boolean isExplored (Coordinate coord)
    {
        return !isUnexplored(coord);
    }

    public final boolean isOxygenStation (Coordinate coord)
    {
        return tileType(coord).equals(TileId.OXYGEN_STATION);
    }

    public final String tileType (Coordinate coord)
    {
        int index = _map.indexOf(new Tile(coord));

        if (index != -1)
        {
            Tile t = _map.get(index);

            return t.content();
        }
        else
            return TileId.UNEXPLORED;
    }

    public final boolean visited (Coordinate coord)
    {
        return _map.contains(coord);
    }

    public final int[] getDimensons ()
    {
        int[] dims = new int[4];

        dims[0] = _minX;
        dims[1] = _maxX;
        dims[2] = _minY;
        dims[3] = _maxY;

        return dims;
    }

    @Override
    public String toString ()
    {
        String str = "--------\n";

        for (int y = _minY; y <= _maxY; y++)
        {
            for (int x = _minX; x <= _maxX; x++)
                str += tileType(new Coordinate(x, y));

            str += "\n";
        }

        str += "--------\n";
        
        return str;
    }

    private Vector<Tile> _map;
    private int _maxX;
    private int _minX;
    private int _maxY;
    private int _minY;
    private Coordinate _oxygenStation;
    private Coordinate _startingPoint;
}
@@ -49,2974 +49,83 @@
 lic 
-Maze ()%0A    %7B%0A        _map = new Vector%3CTile%3E();%0A        _maxX = 0;%0A        _minX = 0;%0A        _maxY = 0;%0A        _minY = 0;%0A        _oxygenStation = null;%0A        _
 sta
-r
 ti
-ngPoint = null;%0A    %7D%0A%0A    public final void updateTile (Coordinate coord, String type)%0A    %7B%0A        Tile t = new Tile(coord, type);%0A        int index = _map.indexOf(t);%0A        %0A        if ((_startingPoint == null) && (TileId.STARTING_POINT.equals(type)))%0A            _startingPoint = coord;%0A        else%0A        %7B%0A            if ((_oxygenStation == null) && (TileId.OXYGEN_STATION.equals(type)))%0A                _oxygenStation = coord;%0A        %7D%0A%0A        if (index == -1)%0A        %7B%0A            if (coord.getX() %3E _maxX)%0A                _maxX = coord.getX();%0A            else%0A            %7B%0A                if (coord.getX() %3C _minX)%0A                    _minX = coord.getX();%0A            %7D%0A%0A            if (coord.getY() %3E _maxY)%0A                _maxY = coord.getY();%0A            else%0A            %7B%0A                if (coord.getY() %3C _minY)%0A                    _minY = coord.getY();%0A            %7D%0A%0A            _map.add(t);%0A        %7D%0A        else%0A            _map.set(index, t);%0A    %7D%0A%0A    public final Coordinate getStartingPoint ()%0A    %7B%0A        return _startingPoint;%0A    %7D%0A%0A    public final Coordinate getOxygenStation ()%0A    %7B%0A        return _oxygenStation;%0A    %7D%0A%0A    public final boolean isWall (Coordinate coord)%0A    %7B%0A        return tileType(coord).equals(TileId.WALL);%0A    %7D%0A%0A    public final boolean isUnexplored (Coordinate coord)%0A    %7B%0A        return tileType(coord).equals(TileId.UNEXPLORED);%0A    %7D%0A    %0A    public final boolean isExplored (Coordinate coord)%0A    %7B%0A        return !isUnexplored(coord);%0A    %7D%0A%0A    public final boolean isOxygenStation (Coordinate coord)%0A    %7B%0A        return tileType(coord).equals(TileId.OXYGEN_STATION);%0A    %7D%0A%0A    public final String tileType (Coordinate coord)%0A    %7B%0A        int index = _map.indexOf(new Tile(coord));%0A%0A        if (index != -1)%0A        %7B%0A            Tile t = _map.get(index);%0A%0A            return t.content();%0A        %7D%0A        else%0A            return TileId.UNEXPLORED;%0A    %7D%0A%0A    public final boolean visited (Coordinate coord)%0A    %7B%0A        return _map.contains(coord);%0A    %7D%0A%0A    public final int%5B%5D getDimensons ()%0A    %7B%0A        int%5B%5D dims = new int%5B4%5D;%0A%0A        dims%5B0%5D = _minX;%0A        dims%5B1%5D = _maxX;%0A        dims%5B2%5D = _minY;%0A        dims%5B3%5D = _maxY;%0A%0A        return dims;%0A    %7D%0A%0A    @Override%0A    public String toString ()%0A    %7B%0A        String str = %22--------%5Cn%22;%0A%0A        for (int y = _minY; y %3C= _maxY; y++)%0A        %7B%0A            for (int x = _minX; x %3C= _maxX; x++)%0A                str += tileType(new Coordinate(x, y));%0A%0A            str += %22%5Cn%22;%0A        %7D%0A%0A        str += %22--------%5Cn%22;%0A        %0A        return str;%0A    %7D%0A%0A    private Vector%3CTile%3E _map;%0A    private int _maxX;%0A    private int _minX;%0A    private int _maxY;%0A    private int _minY;%0A    private Coordinate _oxygenStation;%0A    private Coordinate _startingPoint
+c final String START = %22AA%22;%0A    public static final String EXIT = %22ZZ%22
 ;%0A%7D

Update Maze.java