Package VASSAL.build.module
Class AttachmentManager
java.lang.Object
VASSAL.build.module.AttachmentManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPendingAttachment(Attachment attachnent, String target) Record an Attachment that must be resolved later, the target piece has not been loaded yet.voidA piece has been added to the game. 1.voidclearAll()New game starting, clean all attachment infogetAttachmentList(String attachName) voidpieceAdded(GamePiece piece) voidpieceRemoved(GamePiece piece) removeAttachments(GamePiece piece) A piece is being removed by a Delete or Replace Command.voidremovePiece(GamePiece piece) A piece has been removed from a Map.voidCallback from AttachmentManager aftet end of game load to add Attachments to pieces that had not yet been loaded.
-
Constructor Details
-
AttachmentManager
public AttachmentManager()
-
-
Method Details
-
clearAll
public void clearAll()New game starting, clean all attachment info -
pieceAdded
-
addPiece
A piece has been added to the game. 1. If it has as Auto-attach, attach all other Attachments with same name to it. 2. Tell all other Auto-attach traits with same name to attach to it.Create the self attachment if required
- Parameters:
piece- Piece moved or added
-
pieceRemoved
-
removePiece
A piece has been removed from a Map. If it contains any Attachments, tell all other auto-attachments to that Attachment to forget this piece -
removeAttachments
A piece is being removed by a Delete or Replace Command. Undo any attachments to or from any non-auto-attach Attachment traits it has Auto-attach traits will be cleaned up locally by the client when the piece is removed from the GameState- Parameters:
piece- Piece to clean up Attachments for.- Returns:
- Command to undo attachments.
-
getAttachmentList
-
getAttachmentList
-
addPendingAttachment
Record an Attachment that must be resolved later, the target piece has not been loaded yet.- Parameters:
attachnent- Attachment Traittarget- Id of target piece
-
resolvePendingAttachments
public void resolvePendingAttachments()Callback from AttachmentManager aftet end of game load to add Attachments to pieces that had not yet been loaded.
-