Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.farafin.snEADy.inOut
Class C_LevelLoader

    java.lang.Object
      de.farafin.snEADy.inOut.C_LevelLoader

All Implemented Interfaces:
  I_Constants, I_LevelLoader_interface

    public final class C_LevelLoader

extends java.lang.Object
implements I_Constants, I_LevelLoader_interface

This class loads level files.

Version:
  $Revision: 1.17 $
Author:
  roland, lars
See Also:
  `FileReader`

Field Summary

Fields inherited from interface de.farafin.snEADy.communication.I_Constants
`analyse_ms, auto_grow_delay, auto_slowdown_delay, closemonitor, commandConstants, damage_length_grow, damage_points_radius, DEBUG, delplayer, easy_points, emergencyPause, exit_time, FACE_EAST, FACE_NORTH, FACE_SOUTH, FACE_WEST, goody_length_occ, goody_length_value, goody_points_occ, goody_points_value, goody_shorter_occ, goody_shorter_value, goody_slowdown_occ, goody_speed_occ, IN_ACTION, IN_ERROR_EXC, IN_ERROR_INIT, IN_ERROR_SPACE, IN_ERROR_TIME, IN_EXIT, IN_HEAVEN, init_length, init_move_delay, kill, kill_point_goodies, kill_points_radius, loadhuman, loadlevel, loadplayer, logging, max_goody_occ_delay, MAX_HUMAN_PLAYERS, max_mem_check_delay, max_move_delay, max_player_mem, MAX_PLAYERS, max_thinking_ms, min_cycle_ms, min_move_delay, openmonitor, overalldelay, pause, print_calc_ms, print_parameter, print_player_mem, print_playfield, quit, run, show_subcycles, start, stop, suddend_time, survival_points, timeout_ms, TURN_LEFT, TURN_NONE, TURN_RIGHT`

Constructor Summary
`C_LevelLoader()`

Method Summary
`private D_Level` | `load(java.lang.String root, java.lang.String levName, boolean loadPlayfield)` This method loads the level.
`D_Level` | `loadLevel(java.lang.String levName)` its almost the same funktion, with the root directory of "levels".
`D_Level` | `loadLevel(java.lang.String root, java.lang.String levName)` Loads a level file into a D_Level object
`D_Level` | `loadLevelHeader(java.lang.String levName)` Loads only the header of the File into a D_Level objecrt.
`D_Level` | `loadLevelHeader(java.lang.String root, java.lang.String levName)` Loads only the header of the File into a D_Level objecrt.
`private java.lang.String` | `removeComents(java.lang.String str)` if a string has a coment tag '%' inside, than only the part before its first accuence will be taken and returned.
`private java.lang.String` | `removeSpaces(java.lang.String str)` removes ONLY leading spaces and spaces at the end. spaces in the middle of the string are ignored

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### C_LevelLoader

    public C_LevelLoader()

Method Detail

### removeComents

    private java.lang.String removeComents(java.lang.String str)

  if a string has a coment tag '%' inside, than only the part before its first accuence will be taken and returned.

  Parameters:
    `str` - an string
  Returns:
    the beginning of `str` befre the first '%'

### removeSpaces

    private java.lang.String removeSpaces(java.lang.String str)

  removes ONLY leading spaces and spaces at the end. spaces in the middle of the string are ignored

  Parameters:
    `str` -
  Returns:
    the clear string

### load

    private D_Level load(java.lang.String root,
                         java.lang.String levName,
                         boolean loadPlayfield)
                  throws java.io.FileNotFoundException,
                         E_LevelFileException

  This method loads the level. All other funktions are rooting in here.

  Parameters:
    `root` - the realtive root directory to snEADy mainfolder
    `levName` - The name of the level that should be loaded
    `loadPlayfield` - either the Playfield should be loaded or not.
  Returns:
    the level, if loadPlayfield == false, playFiled will be null.
  Throws:
    `java.io.FileNotFoundException`
    `E_LevelFileException`

### loadLevelHeader

    public D_Level loadLevelHeader(java.lang.String root,
                                   java.lang.String levName)
                            throws E_LevelFileException,
                                   java.io.FileNotFoundException

  Description copied from interface: `I_LevelLoader_interface`
  Loads only the header of the File into a D_Level objecrt. The playfield is ignored.

  Specified by:
    `loadLevelHeader` in interface `I_LevelLoader_interface`
  Returns:
  Throws:
    `E_LevelFileException`
    `java.io.FileNotFoundException`

### loadLevelHeader

    public D_Level loadLevelHeader(java.lang.String levName)
                            throws E_LevelFileException,
                                   java.io.FileNotFoundException

  Description copied from interface: `I_LevelLoader_interface`
  Loads only the header of the File into a D_Level objecrt. The playfield is ignored. its almost the same funktion, with the root directory of "levels".

  Specified by:
    `loadLevelHeader` in interface `I_LevelLoader_interface`
  Parameters:
    `levName` - levName the name of the level that should be loaded. Its the name of the file, the level may have an different name.
  Returns:
    the loaded level see here for file specifications: @see D_ModuleCom.D_File_Level
  Throws:
    `E_LevelFileException` - if the file was found, but in a wrong format
    `java.io.FileNotFoundException` - if the file was not found
  See Also:
    `I_LevelLoader_interface.loadLevelHeader(String, String)`

### loadLevel

    public D_Level loadLevel(java.lang.String root,
                             java.lang.String levName)
                      throws E_LevelFileException,
                             java.io.FileNotFoundException

  Description copied from interface: `I_LevelLoader_interface`
  Loads a level file into a D_Level object

  Specified by:
    `loadLevel` in interface `I_LevelLoader_interface`
  Parameters:
    `root` - the root-path of the levelFolder. Its only possible to point to folders which are subfolders of the gake-folder
    `levName` - the name of the level that should be loaded. Its the name of the file, the level may have an different name.
  Returns:
    the loaded level see here for file specifications: @see D_ModuleCom.D_File_Level
  Throws:
    `E_LevelFileException` - if the file was found, but in a wrong format
    `java.io.FileNotFoundException` - if the file was not found

### loadLevel

    public D_Level loadLevel(java.lang.String levName)
                      throws E_LevelFileException,
                             java.io.FileNotFoundException

  Description copied from interface: `I_LevelLoader_interface`
  its almost the same funktion, with the root directory of "levels".

  Specified by:
    `loadLevel` in interface `I_LevelLoader_interface`
  Parameters:
    `levName` - levName the name of the level that should be loaded. Its the name of the file, the level may have an different name.
  Returns:
    the loaded level see here for file specifications: @see D_ModuleCom.D_File_Level
  Throws:
    `E_LevelFileException` - if the file was found, but in a wrong format
    `java.io.FileNotFoundException` - if the file was not found
  See Also:
    `I_LevelLoader_interface.loadLevel(String, String)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD