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 index 85caf25..2755ba7 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/FieldVisitor.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/FieldVisitor.java @@ -2,6 +2,7 @@ package pp.monopoly.model; import pp.monopoly.model.fields.BuildingProperty; import pp.monopoly.model.fields.EventField; +import pp.monopoly.model.fields.FineField; import pp.monopoly.model.fields.FoodField; import pp.monopoly.model.fields.GateField; import pp.monopoly.model.fields.GoField; @@ -18,4 +19,5 @@ public interface FieldVisitor { T visit(EventField field); T visit(WacheField field); T visit(GoField field); + T visit(FineField field); } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/EventField.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/EventField.java index 0035755..fc2ca57 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/EventField.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/EventField.java @@ -7,8 +7,8 @@ import pp.monopoly.model.card.DeckHelper; public class EventField extends Field{ - public EventField(int id) { - super("EreignissFeld", id); + public EventField(String name, int id) { + super(name, id); } @Override diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/FieldFactory.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/FieldFactory.java new file mode 100644 index 0000000..306be20 --- /dev/null +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/FieldFactory.java @@ -0,0 +1,54 @@ +package pp.monopoly.model.fields; + +import java.util.ArrayList; +import java.util.List; + +public class FieldFactory { + + public static List createBoard() { + ArrayList fields = new ArrayList<>(); + + fields.addLast(new GoField()); + fields.addLast(new BuildingProperty("Gym", 1, 600, 20)); + fields.addLast(new EventField("Hausfeier", 2)); + fields.addLast(new BuildingProperty("Sportplatz", 3, 600, 40)); + fields.addLast(new FineField("Diszi", 4)); + fields.addLast(new GateField("Südtor", 5)); + fields.addLast(new BuildingProperty("Studium+", 6, 1000, 60)); + fields.addLast(new EventField("Üvas", 7)); + fields.addLast(new BuildingProperty("PhysikHörsaal", 8, 1000, 60)); + fields.addLast(new BuildingProperty("Audimax", 9, 1200, 80)); + fields.addLast(new GulagField()); + fields.addLast(new BuildingProperty("99er", 11, 1400, 100)); + fields.addLast(new FoodField("Brandl", 12)); + fields.addLast(new BuildingProperty("12er", 13, 1400, 100)); + fields.addLast(new BuildingProperty("23er", 14, 1600, 120)); + fields.addLast(new GateField("HauptWache", 15)); + fields.addLast(new BuildingProperty("Schwimmhalle", 16, 1800, 140)); + fields.addLast(new BuildingProperty("CISM-Bahn", 17, 1800, 140)); + fields.addLast(new EventField("Marine-Welcome-Party", 18)); + fields.addLast(new BuildingProperty("Kletterturm", 19, 2000, 160)); + fields.addLast(new TestStreckeField()); + fields.addLast(new BuildingProperty("StudFBer C", 21, 2200, 180)); + fields.addLast(new EventField("Üvas", 22)); + fields.addLast(new BuildingProperty("StudFBer B", 23, 2200, 180)); + fields.addLast(new BuildingProperty("StudFBer A", 24, 2400, 200)); + fields.addLast(new GateField("Nordtor", 25)); + fields.addLast(new BuildingProperty("Cascada", 26, 2600, 220)); + fields.addLast(new BuildingProperty("Fakultätsgebäude", 27, 2600, 220)); + fields.addLast(new FoodField("Truppenküche", 28)); + fields.addLast(new BuildingProperty("Prüfungsamt", 29, 2800, 240)); + fields.addLast(new WacheField()); + fields.addLast(new BuildingProperty("Feuerwehr", 31, 3000, 260)); + fields.addLast(new BuildingProperty("SanZ", 32, 300, 260)); + fields.addLast(new EventField("Maibock", 33)); + fields.addLast(new BuildingProperty("Rechenzentrum", 34, 3200, 280)); + fields.addLast(new GateField("Osttor", 35)); + fields.addLast(new EventField("Üvas", 36)); + fields.addLast(new BuildingProperty("2er", 37, 3500, 350)); + fields.addLast(new FineField("EZM", 38)); + fields.addLast(new BuildingProperty("20er", 39, 4000, 500)); + + return fields; + } +} diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/FineField.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/FineField.java new file mode 100644 index 0000000..46cd71f --- /dev/null +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/FineField.java @@ -0,0 +1,17 @@ +package pp.monopoly.model.fields; + +import pp.monopoly.game.server.Player; + +public class FineField extends Field{ + + FineField(String name, int id) { + super(name, id); + } + + @Override + public void accept(Player player) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'accept'"); + } + +} diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/PropertyField.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/PropertyField.java index b8d6438..118daa5 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/PropertyField.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/PropertyField.java @@ -22,4 +22,7 @@ public abstract class PropertyField extends Field { return price; } + public int getHypo() { + return price/2; + } }