Package VASSAL.build.module.map
Interface PieceCollection
- All Known Implementing Classes:
CompoundPieceCollection,DefaultPieceCollection,LayeredPieceCollection.Collection,SimplePieceCollection
public interface PieceCollection
-
Method Summary
Modifier and Type Method Description voidadd(GamePiece p)Adds a piecebooleancanMerge(GamePiece p1, GamePiece p2)Return true if the two pieces can be merged into a single stackvoidclear()Remove all piecesGamePiece[]getAllPieces()Return all pieces in the collection, regardless of visibilityGamePiece[]getPieces()Return all currently-visible pieces in the collection as a read-only arrayintindexOf(GamePiece p)Returns the index of a piece.voidmoveToBack(GamePiece p)Reposition a piece to the back of all others in the same layervoidmoveToFront(GamePiece p)Reposition a piece to the front of all others in the same layervoidremove(GamePiece p)Removes the piece
-
Method Details
-
moveToFront
Reposition a piece to the front of all others in the same layer -
moveToBack
Reposition a piece to the back of all others in the same layer -
getPieces
GamePiece[] getPieces()Return all currently-visible pieces in the collection as a read-only array -
getAllPieces
GamePiece[] getAllPieces()Return all pieces in the collection, regardless of visibility -
canMerge
Return true if the two pieces can be merged into a single stack -
indexOf
Returns the index of a piece. When painting the map, pieces are drawn in order of index -
remove
Removes the piece -
add
Adds a piece -
clear
void clear()Remove all pieces
-