From 1e46b1dc595497f403a8d2ade2182f6ce56815ae Mon Sep 17 00:00:00 2001 From: Daniel Grigencha Date: Thu, 5 Dec 2024 23:54:55 +0100 Subject: [PATCH] Added 'Visitor' interface. Added the 'Visitor' interface to this project. It will be used to handle all types of power cards. --- .../main/java/pp/mdga/visitor/Visitor.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Projekte/mdga/model/src/main/java/pp/mdga/visitor/Visitor.java diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/visitor/Visitor.java b/Projekte/mdga/model/src/main/java/pp/mdga/visitor/Visitor.java new file mode 100644 index 00000000..12e86fd2 --- /dev/null +++ b/Projekte/mdga/model/src/main/java/pp/mdga/visitor/Visitor.java @@ -0,0 +1,39 @@ +package pp.mdga.visitor; + +import pp.mdga.game.card.HiddenCard; +import pp.mdga.game.card.ShieldCard; +import pp.mdga.game.card.SwapCard; +import pp.mdga.game.card.TurboCard; + +/** + * This interface will be used to realize the visitor pattern inside the application. + */ +public interface Visitor { + /** + * This method will be used to visit the given card parameter. + * + * @param card as a TurboCard object. + */ + void visit(TurboCard card); + + /** + * This method will be used to visit the given card parameter. + * + * @param card as a SwapCard object. + */ + void visit(SwapCard card); + + /** + * This method will be used to visit the given card parameter. + * + * @param card as a ShieldCard oblect + */ + void visit(ShieldCard card); + + /** + * This method will be used to visit the given card parameter. + * + * @param card as a HiddenCard object. + */ + void visit(HiddenCard card); +}