|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--VASSAL.build.module.BasicCommandEncoder
A CommandEncoder that handles the basic commands: AddPiece, RemovePiece, ChangePiece, MovePiece. If a module
defines custom GamePiece classes, then this class may be
overriden and imported into the module. Subclasses should override the
createDecorator(java.lang.String, VASSAL.counters.GamePiece) method or, less often, the createBasic(java.lang.String) or createPiece(java.lang.String) methods to allow instantiation
of the custom GamePiece classes.
| Constructor Summary | |
BasicCommandEncoder()
|
|
| Method Summary | |
void |
add(Buildable b)
Adds a child component. |
void |
addTo(Buildable parent)
Adds this component to its parent. |
void |
build(org.w3c.dom.Element e)
Build the object |
protected GamePiece |
createBasic(java.lang.String type)
Create a GamePiece instance that is not a Decorator @param type the type of the GamePiece. |
protected Decorator |
createDecorator(java.lang.String type,
GamePiece inner)
Creates a Decorator instance |
protected GamePiece |
createPiece(java.lang.String type)
Creates a GamePiece instance from the given type information. |
Command |
decode(java.lang.String command)
Translate a String into a Command |
java.lang.String |
encode(Command c)
Translate a Command into a String |
org.w3c.dom.Element |
getBuildElement(org.w3c.dom.Document doc)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BasicCommandEncoder()
| Method Detail |
protected Decorator createDecorator(java.lang.String type,
GamePiece inner)
Decorator instancetype - the type of the Decorator to be created. Once created, the
Decorator should return this value from its Decorator.myGetType() method.inner - the inner piece of the Decorator @see Decoratorprotected GamePiece createBasic(java.lang.String type)
GamePiece.getType()
methodprotected GamePiece createPiece(java.lang.String type)
Decorator or not and
forwards to createDecorator(java.lang.String, VASSAL.counters.GamePiece) or createBasic(java.lang.String). This method should generally not need to be
overridden. Instead, override createDecorator or
createBasicpublic void build(org.w3c.dom.Element e)
Buildablebuild in interface BuildableVASSAL.build.Buildablee - the XML element containing the object datapublic void addTo(Buildable parent)
BuildableaddTo in interface Buildablepublic void add(Buildable b)
BuildableBuildable.addTo(VASSAL.build.Buildable) are
invoked when adding a child to a parentadd in interface Buildablepublic org.w3c.dom.Element getBuildElement(org.w3c.dom.Document doc)
getBuildElement in interface BuildableVASSAL.build.Buildablepublic Command decode(java.lang.String command)
CommandEncoderCommanddecode in interface CommandEncoderpublic java.lang.String encode(Command c)
CommandEncoderCommand into a Stringencode in interface CommandEncoder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||