Class PieceVisitorDispatcher

java.lang.Object
VASSAL.counters.PieceVisitorDispatcher
Direct Known Subclasses:
DeckVisitorDispatcher

public class PieceVisitorDispatcher extends Object
For implementing a modified Visitor pattern on GamePieces. Rather than defining accept() methods in the GamePiece subclasses, this class performs the dispatching of visitors. This allows for easier implementation of custom GamePiece subclasses outside the core engine. A class that wishes to recognize custom GamePiece classes and treat them specially should do so by implementing a sub-interface of PieceVisitor and using a subclass of PieceVisitorDispatcher that recognizes the custom type.
See Also:
  • Constructor Details

    • PieceVisitorDispatcher

      public PieceVisitorDispatcher(PieceVisitor visitor)
  • Method Details