com.threerings.miso.tile
Class FringeConfiguration

java.lang.Object
  extended by com.threerings.miso.tile.FringeConfiguration
All Implemented Interfaces:
Serializable

public class FringeConfiguration
extends Object
implements Serializable

Used to manage data about which base tilesets fringe on which others and how they fringe.

See Also:
Serialized Form

Nested Class Summary
static class FringeConfiguration.FringeRecord
           
static class FringeConfiguration.FringeTileSetRecord
          Used to parse the tileset fringe definitions.
 
Field Summary
protected  HashIntMap<FringeConfiguration.FringeRecord> _frecs
          The mapping from base tileset id to fringerecord.
static String CONFIG_PATH
          The path (relative to the resource directory) at which the fringe configuration should be loaded and stored.
 
Constructor Summary
FringeConfiguration()
           
 
Method Summary
 void addFringeRecord(FringeConfiguration.FringeRecord frec)
          Adds a parsed FringeRecord to this instance.
 int fringesOn(int first, int second)
          If the first base tileset fringes upon the second, return the fringe priority of the first base tileset, otherwise return -1.
 FringeConfiguration.FringeTileSetRecord getFringe(int baseset, int hashValue)
          Get a random FringeTileSetRecord from amongst the ones listed for the specified base tileset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_PATH

public static final String CONFIG_PATH
The path (relative to the resource directory) at which the fringe configuration should be loaded and stored.

See Also:
Constant Field Values

_frecs

protected HashIntMap<FringeConfiguration.FringeRecord> _frecs
The mapping from base tileset id to fringerecord.

Constructor Detail

FringeConfiguration

public FringeConfiguration()
Method Detail

addFringeRecord

public void addFringeRecord(FringeConfiguration.FringeRecord frec)
Adds a parsed FringeRecord to this instance. This is used when parsing the fringerecords from xml.


fringesOn

public int fringesOn(int first,
                     int second)
If the first base tileset fringes upon the second, return the fringe priority of the first base tileset, otherwise return -1.


getFringe

public FringeConfiguration.FringeTileSetRecord getFringe(int baseset,
                                                         int hashValue)
Get a random FringeTileSetRecord from amongst the ones listed for the specified base tileset.