@Override
    public boolean read(DummyObjectList dummyObjects, DummyObject [] dummyTypes, 
        TileMap tileMap) {

	System.out.println("Opening .level file");
	try 
	{ 
	    ResFileReader r;
	    r = new ResFileReader(path);
	    
	    // load tilemap, post names are map, map2, map3 etc.
	    r.gotoPost("map", false);
	    tileMap.setMap(r.readMapArray(), 0);

            boolean layersLeft = true;
            int mapIndex = 2;
            while(layersLeft) {
                try {
                    r.gotoPost("map"+mapIndex, false);
                    tileMap.addMap(r.readMapArray());
                    mapIndex ++;
                } catch (Exception e) {
                    layersLeft = false;
                }
            }

	    // load objects
	    r.gotoPost("init",false);
	    r.nextLine();
	    int loops = 0;
	    while (r.getWord().compareTo("end") != 0 && loops < 1000)
	    {
		loops ++;
		if (r.getWord().compareTo("new") == 0)
		{
		    System.out.println("Adding dummy...");
		    String type = r.getNextWord();
		    int x = r.getNextWordAsInt();
		    int y = r.getNextWordAsInt();
		    int w = r.getNextWordAsInt();
		    int h = r.getNextWordAsInt();
		    String addData = r.getRestOfLine();
		    
		    DummyObject dummy ;
		    boolean found = false;
		    for (int i = 0; i < dummyTypes.length; i++){
			if (dummyTypes[i].name.compareTo(type)==0){
			    found = true;
			    dummy = new DummyObject(dummyTypes[i]);
			    dummy.x = x;
			    dummy.y = y;
			    dummy.w = w;
			    dummy.h = h;
			    dummy.additionalData = addData;
			    dummyObjects.newDummy(dummy);
			}
		    }
		    if (!found){
			System.out.println(
			    "Warning: dummytype "
			    +type+" not defined in def.file!");
		    }
		}
		r.nextLine();
	    }

	}
	catch (Exception e) {
            e.printStackTrace();
	    System.out.println("Error reading *.level file!");
	    return false;
	}

	System.out.println("Init finished");
        return true;
    }