From 8cb13ce0a6b2dd62491ec76459760514c6684a7a Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 3 Dec 2021 10:36:53 +0100 Subject: [PATCH 1/3] change in getCurrentPlayerWinpoints --- src/ch/zhaw/catan/SiedlerGame.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index af4d862..af78ce0 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -407,10 +407,16 @@ public class SiedlerGame { winPoints ++; } } - //todo add points for longest road + if(getLongestRoadFaction() == getCurrentPlayerFaction()){ + winPoints = winPoints + 2; + } return winPoints; } + private Faction getLongestRoadFaction() { + return null; //todo implement + } + /** * Places the thief on the specified field and steals a random resource card (if From 8fc77abdd04f4c16523f86399e8adaa77f47c162 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 3 Dec 2021 10:48:59 +0100 Subject: [PATCH 2/3] added Method toString in City --- src/ch/zhaw/catan/City.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ch/zhaw/catan/City.java b/src/ch/zhaw/catan/City.java index 5e16c18..499bf87 100644 --- a/src/ch/zhaw/catan/City.java +++ b/src/ch/zhaw/catan/City.java @@ -5,4 +5,8 @@ public class City extends Settlement { public City(Config.Faction faction) { super(faction); } + + public String toString() { + return super.getFaction().toString().toUpperCase(); + } } From 7c913089b50c4088e44c087fdeae179ed833617e Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 3 Dec 2021 11:15:07 +0100 Subject: [PATCH 3/3] reated Class Field --- src/ch/zhaw/catan/Field.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/ch/zhaw/catan/Field.java diff --git a/src/ch/zhaw/catan/Field.java b/src/ch/zhaw/catan/Field.java new file mode 100644 index 0000000..38a4774 --- /dev/null +++ b/src/ch/zhaw/catan/Field.java @@ -0,0 +1,18 @@ +package ch.zhaw.catan; + +public class Field { + + private Config.Land land; + + public Field(Config.Land land){ + this.land = land; + } + + public Config.Resource getResource(){ + return land.getResource(); + } + + public Config.Land getLand() { + return land; + } +}