Package VASSAL.build

Class GpIdChecker

java.lang.Object
VASSAL.build.GpIdChecker

public class GpIdChecker
extends Object
Build a cross-reference of all GpId-able elements in a module or ModuleExtension, Check for missing, duplicate or illegal GamePieceId's Update if necessary
  • Field Details

  • Constructor Details

  • Method Details

    • add

      public void add​(PieceSlot pieceSlot)
      Add a PieceSlot to our cross-reference and any PlaceMarker traits it contains.
      Parameters:
      pieceSlot -
    • checkTrait

      protected void checkTrait​(GamePiece gp, PieceSlot slot)
      Check for PlaceMarker traits in a GamePiece and add them to the cross-reference
      Parameters:
      gp -
      slot -
    • testGpId

      protected void testGpId​(String id, VASSAL.build.GpIdChecker.SlotElement element)
      Validate a GamePieceId. - non-null - Integer - Not a duplicate of any other GpId Keep a list of the good Slots and the slots with errors. Also track the maximum GpId
      Parameters:
      id -
      element -
    • hasErrors

      public boolean hasErrors()
      Where any errors found?
      Returns:
    • fixErrors

      public void fixErrors()
      Repair any errors - Update the next GpId in the module if necessary - Generate new GpId's for slots with errors.
    • createUpdatedPiece

      public GamePiece createUpdatedPiece​(GamePiece oldPiece)
      Locate the SlotElement that matches oldPiece and return a new GamePiece created from that Slot.
      Parameters:
      oldPiece -
      Returns:
    • findUpdatedPiece

      public boolean findUpdatedPiece​(GamePiece oldPiece)