Package VASSAL.counters
Interface EditablePiece
- All Superinterfaces:
Auditable
,GamePiece
,PropertySource
- All Known Subinterfaces:
TranslatablePiece
- All Known Implementing Classes:
ActionButton
,AreaOfEffect
,Attachment
,BasicName
,BasicPiece
,BorderOutline
,CalculatedProperty
,Clone
,Comment
,CounterGlobalKeyCommand
,Decorator
,Delete
,Deselect
,DynamicProperty
,Embellishment
,Embellishment0
,Footprint
,FreeRotator
,GlobalHotKey
,Hideable
,Immobilized
,Labeler
,Marker
,Mat
,MatCargo
,MenuSeparator
,MovementMarkable
,MultiLocationCommand
,NonRectangular
,Obscurable
,Pivot
,PlaceMarker
,PlaySound
,PropertySheet
,Replace
,ReportState
,RestrictCommands
,Restricted
,ReturnToDeck
,SendToLocation
,SetGlobalProperty
,SetPieceProperty
,SubMenu
,TableInfo
,TranslatableMessage
,Translate
,TriggerAction
,UsePrototype
If class implementing GamePiece also implements the EditablePiece interface, then
it can be manipulated from the Editor's Configuration Tree via the
PieceDefiner
dialog.
All Decorator
(Trait) classes with a no-arg constructor will appear in the
Available Traits list even if they don't implement EditablePiece.-
Method Summary
Modifier and TypeMethodDescriptiondefault Command
Centralized method used when finishing up after a piece moves.default Command
finishMove
(Command c, boolean afterburner, boolean findmat) default Command
finishMove
(Command c, boolean afterburner, boolean findmat, boolean mark_moved) Centralized method for finishing up after a piece moves.default String
Support for a basic-name-only description introduced later, so this default retrofits it from the full description if an explicit one is not defined.A plain-English description of this type of trait/piece - includes data from fields where appropriatevoid
Sets the information for this piece.default Command
prepareMove
(Command c, boolean mark_moved) Centralized method for preparing a piece to move.Methods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeName
Methods inherited from interface VASSAL.counters.GamePiece
boundingBox, draw, getId, getLocalizedName, getMap, getName, getParent, getPosition, getProperty, getShape, getState, getType, keyEvent, setId, setMap, setParent, setPosition, setProperty, setState
Methods inherited from interface VASSAL.build.module.properties.PropertySource
getLocalizedProperty
-
Method Details
-
getDescription
String getDescription()A plain-English description of this type of trait/piece - includes data from fields where appropriate -
mySetType
Sets the information for this piece. SeeDecorator.myGetType()
- Parameters:
type
- a serialized configuration string to set the "type information" of this piece, which is information that doesn't change during the course of a single game (e.g. Image Files, Context Menu strings, etc). Typically ready to be processed e.g. by SequenceEncoder.decode()
-
getEditor
PieceEditor getEditor()- Returns:
- the configurer for this trait - the dialog which allows the editing the piece's type information
-
getHelpFile
HelpFile getHelpFile()- Returns:
- the help file for this trait
-
getBaseDescription
Support for a basic-name-only description introduced later, so this default retrofits it from the full description if an explicit one is not defined.- Returns:
- name of trait/piece type, w/o additional data
-
prepareMove
Centralized method for preparing a piece to move. Writes the "Old Map" properties based on its current location, optionally marks the piece as moved, and tells any deck its in that it is leaving.- Specified by:
prepareMove
in interfaceGamePiece
- Parameters:
c
- Command to which will be appended a command for recreating anything this method doesmark_moved
- If true the piece will be mark moved- Returns:
- A command for recreating anything this method does, appended to the command passed
-
checkTrueMoved
Centralized method used when finishing up after a piece moves. Checks if LocationName or CurrentMatID changed and marks the piece moved if-and-only-if that happened.- Specified by:
checkTrueMoved
in interfaceGamePiece
- Returns:
- command to replicate any changes on another Vassal instance
-
finishMove
- Specified by:
finishMove
in interfaceGamePiece
-
finishMove
Centralized method for finishing up after a piece moves. Optionally finds a new mat if needed, and optionally applies any afterburner apply-on-move key for the piece's map. If we emptied any decks, allows them to send their I-am-empty key commands- Specified by:
finishMove
in interfaceGamePiece
- Parameters:
c
- Command to which will be appended a command for recreating anything this method doesafterburner
- if true, apply the afterburner apply-on-move key for the piece's mapfindmat
- if true, find a new mat for this piece if needed (if this piece is cargo)- Returns:
- A command for recreating anything this method does, appended to the command passed
-