com.alienfactory.javamappy.loader
Class MapLoader

java.lang.Object
  extended by com.alienfactory.javamappy.loader.MapLoader

public class MapLoader
extends java.lang.Object

MapLoader

Author:
Slimer

Nested Class Summary
protected static class MapLoader.DefaultChunkLoader
           
 
Field Summary
protected  java.util.Hashtable chunkLoaders
           
 
Constructor Summary
MapLoader()
           
 
Method Summary
protected  ChunkLoader createChunkLoader(java.io.InputStream inputStream)
          Factory method for producing instances of ChunkLoaders.
protected  Map doLoadMap(java.io.InputStream inputStream)
          Performs the actual FMP map loading.
static Map loadMap(java.io.InputStream inputStream)
          Helper method to create a Map from the given input stream of .FMP data.
protected  void registerChunkLoader(java.lang.String name, ChunkLoader chunkLoader)
           
protected  void registerChunkLoaders()
          This is where we hard code chunk loader class references to chunk names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chunkLoaders

protected final java.util.Hashtable chunkLoaders
Constructor Detail

MapLoader

public MapLoader()
Method Detail

loadMap

public static Map loadMap(java.io.InputStream inputStream)
                   throws java.lang.IllegalArgumentException,
                          JavaMappyException
Helper method to create a Map from the given input stream of .FMP data.

Note that this method does not close your input stream.

Throws:
java.lang.IllegalArgumentException
JavaMappyException

doLoadMap

protected Map doLoadMap(java.io.InputStream inputStream)
                 throws java.lang.IllegalArgumentException,
                        JavaMappyException
Performs the actual FMP map loading. Not static to allow overriding.

Throws:
java.lang.IllegalArgumentException
JavaMappyException

createChunkLoader

protected ChunkLoader createChunkLoader(java.io.InputStream inputStream)
                                 throws java.lang.IllegalArgumentException,
                                        ChunkLoadException
Factory method for producing instances of ChunkLoaders.
Note: This method does not close the given input stream.

Returns:
a ChunkLoader for the given inputStream
Throws:
java.lang.IllegalArgumentException
ChunkLoadException

registerChunkLoaders

protected void registerChunkLoaders()
This is where we hard code chunk loader class references to chunk names. We do this so that (J2ME) obfuscaters can rename classes. It also allows us to delete empty chunk loader classes like ChunkLoaderLRYx.


registerChunkLoader

protected void registerChunkLoader(java.lang.String name,
                                   ChunkLoader chunkLoader)


Copyright © 2001-2009 Alien-Factory Ltd. All Rights Reserved.