Class CompoundPieceCollection

java.lang.Object
VASSAL.build.module.map.CompoundPieceCollection
All Implemented Interfaces:
PieceCollection
Direct Known Subclasses:
DefaultPieceCollection, LayeredPieceCollection.Collection

public abstract class CompoundPieceCollection extends Object implements PieceCollection
Base class for PieceCollection implementation that organizes GamePieces -- a category which in this case also includes Decks and Stacks, in addition to ordinary pieces -- into distinct visual layers. The layers are drawn in order of their index, i.e. layer 0 is drawn first and thus appears "on the bottom", as higher layers are drawn over top of it.

Maintains, usually on behalf of a Map, lists of all the pieces in each of several layers, along with a set of "enabled" flags marking which layers are disabled/hidden and which are enabled/visible. When a piece is added to the overall collection, its appropriate layer is determined and it is added to the list of pieces on that layer.