From dca23151a88f3596f31ed4a4f00875f79c723d81 Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Tue, 12 Nov 2024 22:33:10 +0100 Subject: [PATCH] added Visitors --- .../java/pp/monopoly/model/CardVisitor.java | 7 +++++++ .../java/pp/monopoly/model/FieldVisitor.java | 21 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Projekte/monopoly/model/src/main/java/pp/monopoly/model/CardVisitor.java create mode 100644 Projekte/monopoly/model/src/main/java/pp/monopoly/model/FieldVisitor.java diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/CardVisitor.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/CardVisitor.java new file mode 100644 index 0000000..257f81f --- /dev/null +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/CardVisitor.java @@ -0,0 +1,7 @@ +package pp.monopoly.model; + +import pp.monopoly.model.card.Card; + +public interface CardVisitor { + T visit(Card c); +} diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/FieldVisitor.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/FieldVisitor.java new file mode 100644 index 0000000..85caf25 --- /dev/null +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/FieldVisitor.java @@ -0,0 +1,21 @@ +package pp.monopoly.model; + +import pp.monopoly.model.fields.BuildingProperty; +import pp.monopoly.model.fields.EventField; +import pp.monopoly.model.fields.FoodField; +import pp.monopoly.model.fields.GateField; +import pp.monopoly.model.fields.GoField; +import pp.monopoly.model.fields.GulagField; +import pp.monopoly.model.fields.TestStreckeField; +import pp.monopoly.model.fields.WacheField; + +public interface FieldVisitor { + T visit(BuildingProperty field); + T visit(FoodField field); + T visit(GateField field); + T visit(GulagField field); + T visit(TestStreckeField field); + T visit(EventField field); + T visit(WacheField field); + T visit(GoField field); +}