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

public interface EditablePiece extends GamePiece
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 Details

    • getDescription

      String getDescription()
      A plain-English description of this type of trait/piece - includes data from fields where appropriate
    • mySetType

      void mySetType(String type)
      Sets the information for this piece. See Decorator.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

      default String 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

      default Command prepareMove(Command c, boolean mark_moved)
      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 interface GamePiece
      Parameters:
      c - Command to which will be appended a command for recreating anything this method does
      mark_moved - If true the piece will be mark moved
      Returns:
      A command for recreating anything this method does, appended to the command passed
    • checkTrueMoved

      default Command 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 interface GamePiece
      Returns:
      command to replicate any changes on another Vassal instance
    • finishMove

      default Command finishMove(Command c, boolean afterburner, boolean findmat)
      Specified by:
      finishMove in interface GamePiece
    • finishMove

      default Command finishMove(Command c, boolean afterburner, boolean findmat, boolean mark_moved)
      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 interface GamePiece
      Parameters:
      c - Command to which will be appended a command for recreating anything this method does
      afterburner - if true, apply the afterburner apply-on-move key for the piece's map
      findmat - 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