Class DefaultPieceCollection

java.lang.Object
VASSAL.build.module.map.CompoundPieceCollection
VASSAL.build.module.map.DefaultPieceCollection
All Implemented Interfaces:
PieceCollection

public class DefaultPieceCollection extends CompoundPieceCollection
Maps now start with a Game Piece Layers component (i.e. LayeredPieceCollection) by default, and so will use that more complex implementation of visual layers. However, the LayeredPieceCollection can be deleted, in which case this simpler implementation is used. This fallback implementation of PieceCollection separates pieces into two visual layers: stacking pieces always drawn above non-stacking pieces
  • Constructor Details

    • DefaultPieceCollection

      public DefaultPieceCollection()
  • Method Details

    • getLayerForPiece

      public int getLayerForPiece(GamePiece p)
      Description copied from class: CompoundPieceCollection
      Default implementation is "degenerate", having only a single layer -- when extending this class, this method takes a piece and determines which of several layers it belongs in, returning an index.
      Overrides:
      getLayerForPiece in class CompoundPieceCollection
      Parameters:
      p - A game piece
      Returns:
      Index for the visual layer the piece should be drawn with.