Class LayeredPieceCollection.Collection

java.lang.Object
VASSAL.build.module.map.CompoundPieceCollection
VASSAL.build.module.map.LayeredPieceCollection.Collection
All Implemented Interfaces:
PieceCollection, DeckVisitor, PieceVisitor
Enclosing class:
LayeredPieceCollection

public static class LayeredPieceCollection.Collection extends CompoundPieceCollection implements DeckVisitor
The PieceCollection class used by the Map to which a LayeredPieceCollection has been added. This replaces the simpler DefaultPieceCollection that the map would ordinarily use. Here we extend CompoundPieceCollection which maintains a list of pieces currently on each layer as well as a set of flags for whether each layer is presently enabled/visible. We simply provide the methods needed to determine which relative layer (i.e. internally-maintained drawing order) a particular piece (or stack) should be grouped with, by querying the designated property of the piece. In the case of a Stack we use its memory of the most recent layer it was in, if a piece is not available.