public class BundledTileSetRepository extends Object implements TileSetRepository
ResourceManager| Constructor and Description |
|---|
BundledTileSetRepository(ResourceManager rmgr,
ImageManager imgr,
String name)
Constructs a repository which will obtain its resource set from the
supplied resource manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBundle(ResourceBundle bundle)
Registers the bundle with the tileset repository, overriding any
bundle with the same id or name.
|
Iterator<Integer> |
enumerateTileSetIds()
Returns an iterator over the identifiers of all
TileSet
objects available. |
Iterator<TileSet> |
enumerateTileSets()
Returns an iterator over all
TileSet objects available. |
TileSet |
getTileSet(int tileSetId)
Returns the
TileSet with the specified tile set
identifier. |
TileSet |
getTileSet(String setName)
Returns the
TileSet with the specified tile set name. |
int |
getTileSetId(String setName)
Returns the unique identifier of the
TileSet with the
specified tile set name. |
public BundledTileSetRepository(ResourceManager rmgr, ImageManager imgr, String name)
rmgr - the resource manager from which to obtain our resource
set.imgr - the image manager through which we will configure the
tile sets to load their images, or null if image tiles
should not be loaded (only the tile metadata)name - the name of the resource set from which we will be
loading our tile data.public void addBundle(ResourceBundle bundle)
public Iterator<Integer> enumerateTileSetIds() throws PersistenceException
TileSetRepositoryTileSet
objects available.enumerateTileSetIds in interface TileSetRepositoryPersistenceExceptionpublic Iterator<TileSet> enumerateTileSets() throws PersistenceException
TileSetRepositoryTileSet objects available.enumerateTileSets in interface TileSetRepositoryPersistenceExceptionpublic TileSet getTileSet(int tileSetId) throws NoSuchTileSetException, PersistenceException
TileSetRepositoryTileSet with the specified tile set
identifier. The repository is responsible for configuring the tile
set with an image provider.getTileSet in interface TileSetRepositoryNoSuchTileSetException - thrown if no tileset exists with
the specified identifier.PersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism.public int getTileSetId(String setName) throws NoSuchTileSetException, PersistenceException
TileSetRepositoryTileSet with the
specified tile set name.getTileSetId in interface TileSetRepositoryNoSuchTileSetException - thrown if no tileset exists with
the specified name.PersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism.public TileSet getTileSet(String setName) throws NoSuchTileSetException, PersistenceException
TileSetRepositoryTileSet with the specified tile set name. The
repository is responsible for configuring the tile set with an
image provider.getTileSet in interface TileSetRepositoryNoSuchTileSetException - thrown if no tileset exists with
the specified name.PersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism.Copyright © 2015. All rights reserved.