• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.assets.AssetManager;
20 import com.badlogic.gdx.graphics.Texture;
21 import com.badlogic.gdx.maps.objects.CircleMapObject;
22 import com.badlogic.gdx.maps.objects.PolygonMapObject;
23 import com.badlogic.gdx.maps.objects.TextureMapObject;
24 import com.badlogic.gdx.maps.tiled.TiledMap;
25 import com.badlogic.gdx.utils.Disposable;
26 
27 /** A generic level map implementation.</p>
28  *
29  * A map has {@link MapProperties} which describe general attributes. Availability of properties depends on the type of map, e.g.
30  * what format is was loaded from etc.</p>
31  *
32  * A map has {@link MapLayers}. Map layers are ordered and indexed. A {@link MapLayer} contains {@link MapObjects} which represent
33  * things within the layer. Different types of {@link MapObject} are available, e.g. {@link CircleMapObject},
34  * {@link TextureMapObject}, and so on.</p>
35  *
36  * A map can be rendered by a {@link MapRenderer}. A MapRenderer implementation may chose to only render specific MapObject or
37  * MapLayer types.</p>
38  *
39  * There are more specialized implementations of Map for specific use cases. e.g. the {@link TiledMap} class and its associated
40  * classes add functionality specifically for tile maps on top of the basic map functionality.</p>
41  *
42  * Maps must be disposed through a call to {@link #dispose()} when no longer used. */
43 public class Map implements Disposable {
44 	private MapLayers layers = new MapLayers();
45 	private MapProperties properties = new MapProperties();
46 
47 	/** Creates empty map */
Map()48 	public Map () {
49 
50 	}
51 
52 	/** @return the map's layers */
getLayers()53 	public MapLayers getLayers () {
54 		return layers;
55 	}
56 
57 	/** @return the map's properties */
getProperties()58 	public MapProperties getProperties () {
59 		return properties;
60 	}
61 
62 	/** Disposes all resources like {@link Texture} instances that the map may own. */
63 	@Override
dispose()64 	public void dispose () {
65 	}
66 }
67