import java.util.*;

/**
 * A map of the tunnel system.
 */

public class Map
{
    public Map (Vector<String> input, boolean debug)
    {
        _theMap = new Vector<Cell>();
        _debug = debug;

        createMap(input);
    }
/*
    @Override
    public String toString ()
    {
        Enumeration<Cell> iter = _theMap.elements();
        int index = 1;
        String str = "";

        while (iter.hasMoreElements())
        {
            str += iter.nextElement().getContents();

            if (index++ == _maxX)
            {
                str += "\n";

                index = 1;
            }
        }

        return str;
    }*/

    protected void createMap (Vector<String> input)
    {
        int lineLength = input.get(0).length(); // all lines are the same length
        Enumeration<String> iter = input.elements();
        int y = -1;

        while (iter.hasMoreElements())
        {
            y++;

            String line = iter.nextElement();

            for (int x = 0; x < line.length(); x++)
            {
                Cell theCell = new Cell(new Coordinate(x, y), line.charAt(x), _debug);

                if (_debug)
                    System.out.println(theCell);

                _theMap.add(theCell);
            }
        }
    }

    protected Vector<Cell> _theMap;
    protected boolean _debug;
}
@@ -227,18 +227,16 @@
 ;%0A    %7D%0A
-/*
 %0A    @Ov
@@ -376,16 +376,22 @@
  str = %22
+Map:%5Cn
 %22;%0A%0A    
@@ -644,18 +644,16 @@
 r;%0A    %7D
-*/
 %0A%0A    pr
@@ -708,89 +708,8 @@
   %7B%0A
-        int lineLength = input.get(0).length(); // all lines are the same length%0A
     
@@ -778,16 +778,89 @@
  = -1;%0A%0A
+        _maxX = input.get(0).length(); // all lines are the same length%0A%0A
         
@@ -1001,21 +1001,13 @@
 x %3C 
-line.length()
+_maxX
 ; x+
@@ -1246,24 +1246,44 @@
  %7D%0A        %7D
+%0A%0A        _maxY = y;
 %0A    %7D%0A%0A    
@@ -1284,23 +1284,21 @@
 %0A%0A    pr
-otec
+iva
 te
-d
  Vector%3C
@@ -1318,23 +1318,67 @@
 ;%0A    pr
-otected
+ivate int _maxX;%0A    private int _maxY;%0A    private
  boolean

Update Map.java