com.b3dgs.lionengine.utility
Class LevelRipConverter<TType extends DefaultTile>

java.lang.Object
  extended by java.lang.Thread
      extended by com.b3dgs.lionengine.utility.LevelRipConverter<TType>
Type Parameters:
TType - tile type used.
All Implemented Interfaces:
java.lang.Runnable

public final class LevelRipConverter<TType extends DefaultTile>
extends java.lang.Thread

This class allows to convert a map image to a map level format. Example:

 LevelRipConverter<Tile> rip = new LevelRipConverter<>();
 rip.start(Files.getMedia("level.png"), this.map, Files.getPath("tiles"), "Forest", false);
 FileWriter fw;
 try {
        fw = File.FILE.createFileWriter(Files.getMedia("level.map"));
        this.map.save(fw);
        fw.close();
 } catch (IOException ex) {
 }
 


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LevelRipConverter()
          Create a new level rip converter.
 
Method Summary
 void run()
           
 void start(java.lang.String levelrip, AbstractTileMap<TType> map, java.lang.String tilesDir, java.lang.String tilesTheme, boolean reversed)
          Must be called to start convertion.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LevelRipConverter

public LevelRipConverter()
Create a new level rip converter.

Method Detail

start

public void start(java.lang.String levelrip,
                  AbstractTileMap<TType> map,
                  java.lang.String tilesDir,
                  java.lang.String tilesTheme,
                  boolean reversed)
Must be called to start convertion.

Parameters:
levelrip - file containing the levelrip as an image.
map - destination map reference.
tilesDir - dir containing tiles themes.
tilesTheme - subdir (theme) for tiles.
reversed - true will read from bottom to top, false will read from top to bottom.

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread