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 import com.badlogic.gdx.graphics.Color;
     20 
     21 /** Generic Map entity with basic attributes like name, opacity, color */
     22 public class MapObject {
     23 	private String name = "";
     24 	private float opacity = 1.0f;
     25 	private boolean visible = true;
     26 	private MapProperties properties = new MapProperties();
     27 	private Color color = Color.WHITE.cpy();
     28 
     29 	/** @return object's name */
     30 	public String getName () {
     31 		return name;
     32 	}
     33 
     34 	/** @param name new name for the object */
     35 	public void setName (String name) {
     36 		this.name = name;
     37 	}
     38 
     39 	/** @return object's color */
     40 	public Color getColor () {
     41 		return color;
     42 	}
     43 
     44 	/** @param color new color for the object */
     45 	public void setColor (Color color) {
     46 		this.color = color;
     47 	}
     48 
     49 	/** @return object's opacity */
     50 	public float getOpacity () {
     51 		return opacity;
     52 	}
     53 
     54 	/** @param opacity new opacity value for the object */
     55 	public void setOpacity (float opacity) {
     56 		this.opacity = opacity;
     57 	}
     58 
     59 	/** @return whether the object is visible or not */
     60 	public boolean isVisible () {
     61 		return visible;
     62 	}
     63 
     64 	/** @param visible toggles object's visibility */
     65 	public void setVisible (boolean visible) {
     66 		this.visible = visible;
     67 	}
     68 
     69 	/** @return object's properties set */
     70 	public MapProperties getProperties () {
     71 		return properties;
     72 	}
     73 }
     74