Class DefaultPieceCollection
java.lang.Object
VASSAL.build.module.map.CompoundPieceCollection
VASSAL.build.module.map.DefaultPieceCollection
- All Implemented Interfaces:
PieceCollection
Map
s 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-
Field Summary
Fields inherited from class VASSAL.build.module.map.CompoundPieceCollection
bottomLayer, enabled, layers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
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.Methods inherited from class VASSAL.build.module.map.CompoundPieceCollection
add, canMerge, canPiecesMerge, canStackAndPieceMerge, canStacksMerge, clear, getAllPieces, getBottomLayer, getCollectionForPiece, getLayerCount, getLayerForName, getLayerNameForPiece, getPieces, getPieces, getTopLayer, indexOf, initLayers, moveToBack, moveToFront, remove, reset, rotate, rotate, setBottomLayer, setLayerEnabled, setLayerEnabled, toggleLayerEnabled, toggleLayerEnabled
-
Constructor Details
-
DefaultPieceCollection
public DefaultPieceCollection()
-
-
Method Details
-
getLayerForPiece
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 classCompoundPieceCollection
- Parameters:
p
- A game piece- Returns:
- Index for the visual layer the piece should be drawn with.
-