code: public int getLayerIndex(String name) {
  		int idx = 0;
  
  		for (int i = 0; i < layers.size(); i++) {
  			Layer layer = (Layer) layers.get(i);
  
  			if (layer.name.equals(name)) {
  				return i;
  			}
  		}
  
  		return -1;
  	}
docs: Get the index of the layer with given name
  
  @param name
  The name of the tile to search for
  @return The index of the layer or -1 if there is no layer with given name