com.threerings.tudey.config
Class PaintableConfig

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.config.ManagedConfig
          extended by com.threerings.config.ParameterizedConfig
              extended by com.threerings.tudey.config.PaintableConfig
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, Exportable, ResourceManager.ModificationObserver, Copyable, Cloneable
Direct Known Subclasses:
GroundConfig, WallConfig

@Strippable
public abstract class PaintableConfig
extends ParameterizedConfig

Base class for GroundConfig and WallConfig.


Nested Class Summary
static class PaintableConfig.Case
          Represents a single case.
static class PaintableConfig.Tile
          Contains a tile that can be used for a case.
protected static class PaintableConfig.TileRotation
          Represents a rotated tile.
 
Field Summary
 
Fields inherited from class com.threerings.config.ParameterizedConfig
_args, _base, _derived, parameters
 
Fields inherited from class com.threerings.config.ManagedConfig
_cfgmgr, _listeners, _name, _updateConfigs, _updateResources
 
Constructor Summary
PaintableConfig()
           
 
Method Summary
static int createPattern(boolean n, boolean nw, boolean w, boolean sw, boolean s, boolean se, boolean e, boolean ne)
          Creates a bit pattern with the supplied directions.
protected static TudeySceneModel.TileEntry createRandomEntry(ArrayList<PaintableConfig.TileRotation> rotations, int elevation)
          Creates an entry using one of the supplied tile rotations.
protected static TudeySceneModel.TileEntry createRandomEntry(ConfigManager cfgmgr, PaintableConfig.Tile[] tiles, int maxWidth, int maxHeight, int elevation)
          Creates a random entry from the specified tile array with the supplied maximum width, and height.
protected static TudeySceneModel.TileEntry createRandomEntry(ConfigManager cfgmgr, PaintableConfig.Tile[] tiles, int mask, int maxWidth, int maxHeight, int elevation)
          Creates a random entry from the specified tile array with the supplied rotation mask, maximum width, and maximum height.
protected static IntTuple getCaseRotations(PaintableConfig.Case[] cases, int pattern)
          Determines the case and allowed rotations of the edge tile that matches the specified pattern.
protected static boolean matchesAny(PaintableConfig.Case[] cases, TudeySceneModel.TileEntry entry, IntTuple caseRotations, int elevation)
          Checks whether the specified entry matches the specified case index/rotation pair.
protected static boolean matchesAny(PaintableConfig.Tile[] tiles, TudeySceneModel.TileEntry entry, int elevation)
          Checks whether the specified entry matches any of the tiles in the given array.
 
Methods inherited from class com.threerings.config.ParameterizedConfig
applyArguments, applyArguments, getBound, getInstance, getParameter, getParameter, getReference, maybeFireOnConfigManager, validateOuters, validateReferences, wasUpdated
 
Methods inherited from class com.threerings.config.ManagedConfig
addListener, addUpdateDependencies, clearUpdateDependencies, configUpdated, fireConfigUpdated, getConfigManager, getInstance, getInstance, getInstance, getInstance, getName, getUpdateReferences, getUpdateResources, init, removeListener, resourceModified, setName, updateFromSource
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PaintableConfig

public PaintableConfig()
Method Detail

createPattern

public static int createPattern(boolean n,
                                boolean nw,
                                boolean w,
                                boolean sw,
                                boolean s,
                                boolean se,
                                boolean e,
                                boolean ne)
Creates a bit pattern with the supplied directions.


getCaseRotations

protected static IntTuple getCaseRotations(PaintableConfig.Case[] cases,
                                           int pattern)
Determines the case and allowed rotations of the edge tile that matches the specified pattern.


matchesAny

protected static boolean matchesAny(PaintableConfig.Case[] cases,
                                    TudeySceneModel.TileEntry entry,
                                    IntTuple caseRotations,
                                    int elevation)
Checks whether the specified entry matches the specified case index/rotation pair.


matchesAny

protected static boolean matchesAny(PaintableConfig.Tile[] tiles,
                                    TudeySceneModel.TileEntry entry,
                                    int elevation)
Checks whether the specified entry matches any of the tiles in the given array.


createRandomEntry

protected static TudeySceneModel.TileEntry createRandomEntry(ConfigManager cfgmgr,
                                                             PaintableConfig.Tile[] tiles,
                                                             int maxWidth,
                                                             int maxHeight,
                                                             int elevation)
Creates a random entry from the specified tile array with the supplied maximum width, and height.


createRandomEntry

protected static TudeySceneModel.TileEntry createRandomEntry(ConfigManager cfgmgr,
                                                             PaintableConfig.Tile[] tiles,
                                                             int mask,
                                                             int maxWidth,
                                                             int maxHeight,
                                                             int elevation)
Creates a random entry from the specified tile array with the supplied rotation mask, maximum width, and maximum height.


createRandomEntry

protected static TudeySceneModel.TileEntry createRandomEntry(ArrayList<PaintableConfig.TileRotation> rotations,
                                                             int elevation)
Creates an entry using one of the supplied tile rotations.