net.jetrix.filter
Class DownstackPuzzleGenerator

java.lang.Object
  extended by net.jetrix.filter.DownstackPuzzleGenerator
All Implemented Interfaces:
PuzzleGenerator

public class DownstackPuzzleGenerator
extends Object
implements PuzzleGenerator

Puzzle generator supporting the puzzle format used by the 2ice server, aka downstack.com. Each puzzle consists in two files, a .field file containing the description of the field, and a .settings file containing the game settings and the puzzle description. By default the puzzle files are looked for in the data/puzzle sub directory, this can be overridden by setting the path parameter.

Since:
0.3
Version:
$Revision: 836 $, $Date: 2010-04-11 23:25:35 +0200 (dim., 11 avr. 2010) $
Author:
Emmanuel Bourg

Field Summary
static Block[] BLOCKS
          The order or the specials used in the settings file.
 
Constructor Summary
DownstackPuzzleGenerator()
           
 
Method Summary
protected  File[] getLevels()
          Find all levels in the puzzle directory.
 Puzzle getNextPuzzle()
          Generates the next puzzle.
 void init(Configuration config)
          Initializes the generator.
protected  Puzzle loadPuzzle(File directory, String name)
          Load a puzzle from the filesystem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCKS

public static final Block[] BLOCKS
The order or the specials used in the settings file.

Constructor Detail

DownstackPuzzleGenerator

public DownstackPuzzleGenerator()
Method Detail

init

public void init(Configuration config)
Description copied from interface: PuzzleGenerator
Initializes the generator.

Specified by:
init in interface PuzzleGenerator
Parameters:
config - the configuration containing the configuration parameters.

getNextPuzzle

public Puzzle getNextPuzzle()
Description copied from interface: PuzzleGenerator
Generates the next puzzle.

Specified by:
getNextPuzzle in interface PuzzleGenerator

loadPuzzle

protected Puzzle loadPuzzle(File directory,
                            String name)
                     throws IOException
Load a puzzle from the filesystem.

Parameters:
directory - the directory containing the puzzle file
name - the name of the puzzle
Throws:
IOException

getLevels

protected File[] getLevels()
Find all levels in the puzzle directory.



Copyright © 2001-2010. All Rights Reserved.