|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.cast.bundle.BundledComponentRepository
public class BundledComponentRepository
A component repository implementation that obtains information from resource bundles.
ResourceManager| Nested Class Summary | |
|---|---|
protected class |
BundledComponentRepository.ResourceBundleProvider
Instances of these provide images to our component action tilesets and frames to our components. |
static class |
BundledComponentRepository.TileSetFrameImage
Used to provide multiframe images using data obtained from a tileset. |
| Field Summary | |
|---|---|
protected Map<String,ActionSequence> |
_actions
A table of action sequences. |
protected Map<String,TileSet> |
_actionSets
A table of action sequence tilesets. |
protected Map<String,ArrayList<CharacterComponent>> |
_classComps
A table of component lists indexed on classname. |
protected Map<String,ComponentClass> |
_classes
A table of component classes. |
protected IntMap<CharacterComponent> |
_components
The component table. |
protected ImageManager |
_imgr
We use the image manager to decode and cache images. |
protected boolean |
_wipeOnFailure
Whether or not we wipe our bundles on any failure. |
| Fields inherited from interface com.threerings.util.DirectionCodes |
|---|
CARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST |
| Constructor Summary | |
|---|---|
BundledComponentRepository(ResourceManager rmgr,
ImageManager imgr,
String name)
Constructs a repository which will obtain its resource set from the supplied resource manager. |
|
| Method Summary | |
|---|---|
protected void |
createComponent(int componentId,
String cclass,
String cname,
FrameProvider fprov)
Creates a component and inserts it into the component table. |
protected BundledComponentRepository.TileSetFrameImage |
createTileSetFrameImage(TileSet aset,
ActionSequence actseq)
|
Iterator<ActionSequence> |
enumerateActionSequences()
Iterates over the ActionSequence instances representing every available action
sequence. |
Iterator<ComponentClass> |
enumerateComponentClasses()
Iterates over the ComponentClass instances representing all available character
component classes. |
Iterator<Integer> |
enumerateComponentIds(ComponentClass compClass)
Iterates over the component ids of all components in the specified class. |
CharacterComponent |
getComponent(int componentId)
Returns the CharacterComponent object for the given component identifier. |
CharacterComponent |
getComponent(String className,
String compName)
Returns the CharacterComponent object with the given component class and name. |
ComponentClass |
getComponentClass(String className)
Returns the ComponentClass with the specified name or null if none exists with that
name. |
void |
setWipeOnFailure(boolean wipeOnFailure)
Configures the bundled component repository to wipe any bundles that report certain kinds of failure. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ImageManager _imgr
protected Map<String,ActionSequence> _actions
protected Map<String,TileSet> _actionSets
protected Map<String,ComponentClass> _classes
protected Map<String,ArrayList<CharacterComponent>> _classComps
protected IntMap<CharacterComponent> _components
protected boolean _wipeOnFailure
| Constructor Detail |
|---|
public BundledComponentRepository(ResourceManager rmgr,
ImageManager imgr,
String name)
throws IOException
rmgr - the resource manager from which to obtain our resource set.imgr - the image manager that we'll use to decode and cache images.name - the name of the resource set from which we will be loading our component data.
IOException - thrown if an I/O error occurs while reading our metadata from the
resource bundles.| Method Detail |
|---|
public void setWipeOnFailure(boolean wipeOnFailure)
public CharacterComponent getComponent(int componentId)
throws NoSuchComponentException
ComponentRepositoryCharacterComponent object for the given component identifier.
getComponent in interface ComponentRepositoryNoSuchComponentException
public CharacterComponent getComponent(String className,
String compName)
throws NoSuchComponentException
ComponentRepositoryCharacterComponent object with the given component class and name.
getComponent in interface ComponentRepositoryNoSuchComponentExceptionpublic ComponentClass getComponentClass(String className)
ComponentRepositoryComponentClass with the specified name or null if none exists with that
name.
getComponentClass in interface ComponentRepositorypublic Iterator<ComponentClass> enumerateComponentClasses()
ComponentRepositoryComponentClass instances representing all available character
component classes.
enumerateComponentClasses in interface ComponentRepositorypublic Iterator<ActionSequence> enumerateActionSequences()
ComponentRepositoryActionSequence instances representing every available action
sequence.
enumerateActionSequences in interface ComponentRepositorypublic Iterator<Integer> enumerateComponentIds(ComponentClass compClass)
ComponentRepository
enumerateComponentIds in interface ComponentRepository
protected void createComponent(int componentId,
String cclass,
String cname,
FrameProvider fprov)
protected BundledComponentRepository.TileSetFrameImage createTileSetFrameImage(TileSet aset,
ActionSequence actseq)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||