Package VASSAL.build.module.map
Class SimplePieceCollection
java.lang.Object
VASSAL.build.module.map.SimplePieceCollection
- All Implemented Interfaces:
PieceCollection
public class SimplePieceCollection extends Object implements PieceCollection
Stores
GamePieces in a simple array-
Constructor Summary
Constructors Constructor Description SimplePieceCollection() -
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 piecevoidreposition(GamePiece p, int pos)
-
Constructor Details
-
SimplePieceCollection
public SimplePieceCollection()
-
-
Method Details
-
indexOf
Returns the index of a piece. When painting the map, pieces are drawn in order of index- Specified by:
indexOfin interfacePieceCollection
-
canMerge
Description copied from interface:PieceCollectionReturn true if the two pieces can be merged into a single stack- Specified by:
canMergein interfacePieceCollection
-
add
Description copied from interface:PieceCollectionAdds a piece- Specified by:
addin interfacePieceCollection
-
clear
public void clear()Description copied from interface:PieceCollectionRemove all pieces- Specified by:
clearin interfacePieceCollection
-
remove
Description copied from interface:PieceCollectionRemoves the piece- Specified by:
removein interfacePieceCollection
-
getPieces
Description copied from interface:PieceCollectionReturn all currently-visible pieces in the collection as a read-only array- Specified by:
getPiecesin interfacePieceCollection
-
getAllPieces
Description copied from interface:PieceCollectionReturn all pieces in the collection, regardless of visibility- Specified by:
getAllPiecesin interfacePieceCollection
-
reposition
-
moveToBack
Description copied from interface:PieceCollectionReposition a piece to the back of all others in the same layer- Specified by:
moveToBackin interfacePieceCollection
-
moveToFront
Description copied from interface:PieceCollectionReposition a piece to the front of all others in the same layer- Specified by:
moveToFrontin interfacePieceCollection
-