Home | History | Annotate | Download | only in maps
      1 /*******************************************************************************
      2  * Copyright 2011 See AUTHORS file.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *   http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  ******************************************************************************/
     16 
     17 package com.badlogic.gdx.maps;
     18 
     19 /** Map layer containing a set of objects and properties */
     20 public class MapLayer {
     21 	private String name = "";
     22 	private float opacity = 1.0f;
     23 	private boolean visible = true;
     24 	private MapObjects objects = new MapObjects();
     25 	private MapProperties properties = new MapProperties();
     26 
     27 	/** @return layer's name */
     28 	public String getName () {
     29 		return name;
     30 	}
     31 
     32 	/** @param name new name for the layer */
     33 	public void setName (String name) {
     34 		this.name = name;
     35 	}
     36 
     37 	/** @return layer's opacity */
     38 	public float getOpacity () {
     39 		return opacity;
     40 	}
     41 
     42 	/** @param opacity new opacity for the layer */
     43 	public void setOpacity (float opacity) {
     44 		this.opacity = opacity;
     45 	}
     46 
     47 	/** @return collection of objects contained in the layer */
     48 	public MapObjects getObjects () {
     49 		return objects;
     50 	}
     51 
     52 	/** @return whether the layer is visible or not */
     53 	public boolean isVisible () {
     54 		return visible;
     55 	}
     56 
     57 	/** @param visible toggles layer's visibility */
     58 	public void setVisible (boolean visible) {
     59 		this.visible = visible;
     60 	}
     61 
     62 	/** @return layer's set of properties */
     63 	public MapProperties getProperties () {
     64 		return properties;
     65 	}
     66 }
     67