From 0db6be32b6d02a530adec8df23acc39f6c197fe3 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 26 Nov 2021 10:05:02 +0100 Subject: [PATCH 1/5] Road.java and changes SiedlerGame buildRoad Method --- .gitignore | 1 + .../ch/zhaw/catan/Config$Faction.class | Bin 1465 -> 1465 bytes .../ch/zhaw/catan/Config$Land.class | Bin 2136 -> 2136 bytes .../ch/zhaw/catan/Config$Resource.class | Bin 1530 -> 1530 bytes .../ch/zhaw/catan/Config$Structure.class | Bin 2969 -> 2969 bytes .../ch/zhaw/catan/Config.class | Bin 3892 -> 3892 bytes .../ch/zhaw/catan/Dummy$1.class | Bin 702 -> 702 bytes .../ch/zhaw/catan/Dummy$Actions.class | Bin 1113 -> 1113 bytes .../ch/zhaw/catan/Dummy.class | Bin 3788 -> 3788 bytes .../ch/zhaw/catan/SiedlerBoard.class | Bin 5398 -> 5365 bytes .../ch/zhaw/catan/SiedlerBoardTextView.class | Bin 681 -> 681 bytes .../ch/zhaw/catan/SiedlerGame.class | Bin 2586 -> 2740 bytes .../ch/zhaw/hexboard/Edge.class | Bin 2689 -> 2689 bytes .../hexboard/FieldAnnotationPosition.class | Bin 2239 -> 2239 bytes .../ch/zhaw/hexboard/HexBoard.class | Bin 12025 -> 12025 bytes .../ch/zhaw/hexboard/HexBoardTextView.class | Bin 8235 -> 8235 bytes .../ch/zhaw/hexboard/Label.class | Bin 1235 -> 1235 bytes src/ch/zhaw/catan/Road.java | 13 +++++++++++++ 18 files changed, 14 insertions(+) create mode 100644 .gitignore create mode 100644 src/ch/zhaw/catan/Road.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a3417b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/out/ diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Faction.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Faction.class index d312fff43d77181fa04aeec4c5c291969fba6a77..a9c9a44e6bb763d39b275dcbf6f35d961bad970d 100644 GIT binary patch delta 17 ZcmdnVy_1{c)W2Q(7#J9AHgara1pq*%27CYj delta 17 ZcmdnVy_1{c)W2Q(7#J9AH*#!b1pq*+27Lek diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Land.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Land.class index 2a20065c61fe93f6bc65a3beb56983a3a86d994f..a0e3700d37eb7ebebe102891270c75592f6aa796 100644 GIT binary patch delta 29 lcmca1a6>@g)W2Q(7#J9A7)sa~m>3x(CtqX|-Kc8J0RWgZ2!H?p delta 29 lcmca1a6>@g)W2Q(7#J9A8A{k0m>3x(CtqX|-Kc8J0RWgq2!Q|q diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Resource.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Resource.class index 58f80c19d826c4c3d20a93bb7cc34cd58bfbf4c1..82c496d4a344d4551e973a178c0d2b1feb11773f 100644 GIT binary patch delta 17 Zcmeyx{fnF9)W2Q(7#J9AHgbGo1prA%2R{G+ delta 17 Zcmeyx{fnF9)W2Q(7#J9AH*$Pp1prA+2S5M- diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Structure.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config$Structure.class index 169ab41df0a499b0974a70ca692c220aade8ba7a..cfb923789cbee4999b3277de56d6adbfb46ab006 100644 GIT binary patch delta 29 lcmbO!K2u!a)W2Q(7#J9A7`oXRm>3yECVylW*{D*=4FHaJ2!;Rv delta 29 lcmbO!K2u!a)W2Q(7#J9A8M@gSm>3yECVylW*{D*=4FHaa2!{Xw diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Config.class index 922ab81f29087b69126385b1f5d1e57df820260c..598fcb0bcb49d4a9e62bbb1a06337c38fcce3681 100644 GIT binary patch delta 17 ZcmdlYw?&TQ)W2Q(7#J9AHgf3j0{}rl1|0wZ delta 17 ZcmdlYw?&TQ)W2Q(7#J9AH*)Ck0{}rq1|9$a diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$1.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$1.class index f4062e0543dd7a05698bdfc914692770f987eff1..8567a9baf96bfafe29eaf344e89d39a5ee1dcf7d 100644 GIT binary patch delta 23 fcmdnTx{sCP)W2Q(7#J9AHgcphF{)24VDbY1X}|}l delta 23 fcmdnTx{sCP)W2Q(7#J9AH*%yiF{({2VDbY1X~qYr diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$Actions.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$Actions.class index 3410db753ca6458025bf856739f3d98ae36bec03..0d99f9f2a2000f589248dd6620c2a76c84bb5e38 100644 GIT binary patch delta 17 Zcmcb~ag&4N)W2Q(7#J9AHgW{A002Xa22}t6 delta 17 Zcmcb~ag&4N)W2Q(7#J9AH*y5B002Xf237z7 diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy.class index d1759cf92ad3f595b71d525c136ce70d21351b66..09c27a7c753f40354200852b54a7f35916c4c323 100644 GIT binary patch delta 127 zcmX>jdq$Sy)W2Q(7#J9AHgcTci4Fnpu}*NL7CwKgDS&i1~rBo4C;(544RDm3|fpr3_6UW47!XG4El^p f3`UG<491f+d7m?yO%~)!W3^)7Vz8cE!xsPm99I^6 delta 127 zcmX>jdq$Sy)W2Q(7#J9AH*%cdi49WDsKzWDsXiWRPGmWRPU=WRPM=WRPLV zVvuEMV~}H*z@Wge1t@!#L5bl4g9^iC233X|3~G!l3>u9544RB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R24L%ugs#(90|AGvB=xVszQ_FSyA&lR}(a&Ds_UWBP;usoO_4&bQdKH p=_Zy{d5(*MQ8H#A))}ZV_9HQp|0`a>2V*}XY#(WA-TYI0+Ha^T-5me` diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/SiedlerBoardTextView.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/SiedlerBoardTextView.class index fd38f027ff1bd27d5b16552c99dd8824201047dd..26d90d1065f9c2e5fd1d0f89628fb2679cba5c4b 100644 GIT binary patch delta 17 ZcmZ3?Y!DUH)Y>#{AR3yQgjShxI;WeH=D>Ehv)K^J zAMkg0?}d&ZI6A`}H~s_vg4bRzt*t6&3eV+IG{qx`7UlP$WeKkP=3Pvat zqcDvzntIHi@|4M~{Zw)9u`palW6RQ#?h2z|BDo!*aYh%6dg^(dw^9aoxs@tQQ8k6L zW^<=HK@kc@=?#iS=v0i}q)A4z1I6$01HmY~r%;S876uAw&a@&u9izB1Fm5=4yCNr_ zDT105CUl;qa}k=3(F~nubWXd_bfuZf+NKE~q-`}AMa99PdsL7O_!Lhh3$Ml0U7FEM zuK2LDTPf}qH#c@GrOf)qZZVhJC^2GrMyIl1fxGTDH=81e=!FmwOThn6b`f~UW}A*9tmAetn(u@5sA4qN3oeO< z-E<65c5UMcqbrFXJ>nH9r7c)2{eP~R5x|W=ID&8eWbk{N=MXzaM|S!h$3pg zVF4R;>yF)8mxijfM83P`AMis}Mpe9NAx1`@z=$;WbkGp#PMlYCT}S$sik@ehi8{eq&u(8S`;H1R7<{fMUkln@4W2g!=*5MzjPAHodR4eLx@j z9IN=N{PuG^*BoB@+S(Pz9l8sQ+I>VHV`cOSrAM-TJA`ey!}ck5ifx5H!+#zcI{x)V z=DQ*Ot?JV9Qj`JL8fAUUI$V9R`e_K4=O?4}6L7p5!Lf0I2>o^92<7PB$aw!fgzdhr z0F}Kwb}HVVpP&-|(QID#wQGUV7o#J?LPH``(0LEg16@g*RK!0Hd$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class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/hexboard/FieldAnnotationPosition.class index 50b3008ccbd52a872ad8a498800786b7129d62dc..064c70d60828d7a4384f85d8d86b2dd9c4a59b42 100644 GIT binary patch delta 17 ZcmdllxL=Ut)W2Q(7#J9AHgas|002TM2Au!^ delta 17 ZcmdllxL=Ut)W2Q(7#J9AH*##}002TR2A%)_ diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/hexboard/HexBoard.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/hexboard/HexBoard.class index 54b55a6018c5c241225ea1f2bc50d808f5cef6a3..c212f56dfbb74bb24fc3dab4a53e704eb7cfc170 100644 GIT binary patch delta 17 Zcmewv`!kl~)W2Q(7#J9AHgbH_0{~L%2nhfH delta 17 Zcmewv`!kl~)W2Q(7#J9AH*$Q`0{~L+2nqlI diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/hexboard/HexBoardTextView.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/hexboard/HexBoardTextView.class index d987cad504653507643f6993f19be18b860f1b89..9904f75d53df6123bc2d5ba3cae6853767877e7b 100644 GIT binary patch delta 17 ZcmZ4Ou-bv+)W2Q(7#J9AHgYH{002ZA23G(8 delta 17 ZcmZ4Ou-bv+)W2Q(7#J9AH*zQ|002ZF23P<9 diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/hexboard/Label.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/hexboard/Label.class index 3dd5342468f73a225021be99f765b9a921438683..85f914830010a10f0d03bf5bf51d31549fa8f97e 100644 GIT binary patch delta 17 Zcmcc2d6|>r)W2Q(7#J9AHgcS10RThY2E_mX delta 17 Zcmcc2d6|>r)W2Q(7#J9AH*%b20RThd2F3sY diff --git a/src/ch/zhaw/catan/Road.java b/src/ch/zhaw/catan/Road.java new file mode 100644 index 0000000..24025c5 --- /dev/null +++ b/src/ch/zhaw/catan/Road.java @@ -0,0 +1,13 @@ +package ch.zhaw.catan; + +import java.util.HashMap; + +public class Road { + HashMap buildCost; + + public Road() { + buildCost = new HashMap<>(); + buildCost.put(Config.Resource.BRICK,1); + buildCost.put(Config.Resource.LUMBER,1); + } +} From 456ea5356f0b8e71ec4dee95433493ecf36af2e3 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 26 Nov 2021 10:43:04 +0100 Subject: [PATCH 2/5] Settlement.java and changes SiedlerGame buildRoad Method --- src/ch/zhaw/catan/Road.java | 6 +++++- src/ch/zhaw/catan/Settlement.java | 20 ++++++++++++++++++++ src/ch/zhaw/catan/SiedlerGame.java | 13 ++++++++++++- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/ch/zhaw/catan/Settlement.java diff --git a/src/ch/zhaw/catan/Road.java b/src/ch/zhaw/catan/Road.java index 24025c5..92ac502 100644 --- a/src/ch/zhaw/catan/Road.java +++ b/src/ch/zhaw/catan/Road.java @@ -3,11 +3,15 @@ package ch.zhaw.catan; import java.util.HashMap; public class Road { - HashMap buildCost; + private HashMap buildCost; public Road() { buildCost = new HashMap<>(); buildCost.put(Config.Resource.BRICK,1); buildCost.put(Config.Resource.LUMBER,1); } + + public HashMap getBuildCost() { + return buildCost; + } } diff --git a/src/ch/zhaw/catan/Settlement.java b/src/ch/zhaw/catan/Settlement.java new file mode 100644 index 0000000..289e9e8 --- /dev/null +++ b/src/ch/zhaw/catan/Settlement.java @@ -0,0 +1,20 @@ +package ch.zhaw.catan; + +import java.util.HashMap; + +public class Settlement { + private HashMap buildCost; + + public Settlement() { + buildCost = new HashMap<>(); + buildCost.put(Config.Resource.LUMBER,1); + buildCost.put(Config.Resource.BRICK,1); + buildCost.put(Config.Resource.GRAIN,1); + buildCost.put(Config.Resource.WOOL,1); + } + + public HashMap getBuildCost() { + return buildCost; + } + +} diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 48405eb..695b23a 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -212,7 +212,18 @@ public class SiedlerGame { * @return true, if the placement was successful */ public boolean buildRoad(Point roadStart, Point roadEnd) { - // TODO: Implement + //1. Check if Edge + if(!board.hasEdge(roadStart,roadEnd)){ + // TODO: Error message + } + //2. Check if Edge is empty + if(board.getEdge(roadStart,roadEnd) != null) { + // TODO: Error message + } + //3. Can Player build road + // TODO + + return false; } From 5e8db04f0da10907c24efdc6042f0f62ed6fadb3 Mon Sep 17 00:00:00 2001 From: Speedy Gonzalez Date: Fri, 26 Nov 2021 10:58:19 +0100 Subject: [PATCH 3/5] Added new class player. --- .idea/misc.xml | 2 +- src/ch/zhaw/catan/Player.java | 20 ++++++++++++++++++++ src/ch/zhaw/hexboard/HexBoardTextView.java | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/ch/zhaw/catan/Player.java diff --git a/.idea/misc.xml b/.idea/misc.xml index c3dfb30..6bc01a8 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/ch/zhaw/catan/Player.java b/src/ch/zhaw/catan/Player.java new file mode 100644 index 0000000..63490f3 --- /dev/null +++ b/src/ch/zhaw/catan/Player.java @@ -0,0 +1,20 @@ +package ch.zhaw.catan; + +import java.util.ArrayList; + +/** + * New Class PLayer + * This class is here to add players to the game. + * @author: Stefan Amador + */ +public class Player { + + private String name; + private Config.Faction faction; + private Config.Resource resource; + + public Player (String name, Config.Faction faction){ + this.name = new name(" "); + + } +} diff --git a/src/ch/zhaw/hexboard/HexBoardTextView.java b/src/ch/zhaw/hexboard/HexBoardTextView.java index 97c51af..b3eeb98 100644 --- a/src/ch/zhaw/hexboard/HexBoardTextView.java +++ b/src/ch/zhaw/hexboard/HexBoardTextView.java @@ -98,7 +98,7 @@ import java.util.Map; public class HexBoardTextView { private static final String ONE_SPACE = " "; - private static final String TWO_SPACES = " "; + private static final String TWO_SPACES = " "; private static final String FOUR_SPACES = " "; private static final String FIVE_SPACES = " "; private static final String SIX_SPACES = " "; From 3adec5bd43c20470d1890558e80f8cd360a9bbc2 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 26 Nov 2021 11:25:56 +0100 Subject: [PATCH 4/5] changed Datatype of Road and Settlement in SiedlerBoard --- .idea/misc.xml | 2 +- .../ch/zhaw/catan/Dummy$1.class | Bin 702 -> 702 bytes .../ch/zhaw/catan/Dummy$Actions.class | Bin 1113 -> 1113 bytes .../ch/zhaw/catan/Dummy.class | Bin 3788 -> 0 bytes .../ch/zhaw/catan/SiedlerBoard.class | Bin 5365 -> 5365 bytes .../ch/zhaw/catan/SiedlerGame.class | Bin 2740 -> 2740 bytes src/ch/zhaw/catan/Dummy.java | 5 ++--- src/ch/zhaw/catan/Road.java | 4 +++- src/ch/zhaw/catan/Settlement.java | 4 +++- src/ch/zhaw/catan/SiedlerBoard.java | 2 +- 10 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy.class diff --git a/.idea/misc.xml b/.idea/misc.xml index 6bc01a8..c3dfb30 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$1.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$1.class index 8567a9baf96bfafe29eaf344e89d39a5ee1dcf7d..f4062e0543dd7a05698bdfc914692770f987eff1 100644 GIT binary patch delta 23 fcmdnTx{sCP)W2Q(7#J9AH*%yiF{({2VDbY1X~qYr delta 23 fcmdnTx{sCP)W2Q(7#J9AHgcphF{)24VDbY1X}|}l diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$Actions.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy$Actions.class index 0d99f9f2a2000f589248dd6620c2a76c84bb5e38..3410db753ca6458025bf856739f3d98ae36bec03 100644 GIT binary patch delta 17 Zcmcb~ag&4N)W2Q(7#J9AH*y5B002Xf237z7 delta 17 Zcmcb~ag&4N)W2Q(7#J9AHgW{A002Xa22}t6 diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/Dummy.class deleted file mode 100644 index 09c27a7c753f40354200852b54a7f35916c4c323..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3788 zcmb7H`F9&v75<*Jj4V&$Eq0=;imN1+Q%6ZlO>LPtt`{mQ+r>5xPH15)P2@?W88aTm zaamfREiG%<2}{`tP?k0nJFZC@plk)sfzx03TR0rT_hzJ6@=}V@`foIVs?4k57dWLalUO~}wYP8h9-NM?2m1lm)n_*5=duq7G$qy1;!~VBX^-D7{b&0e# zqvyluMz74%+hm>w2I5n7=))-m{VE>7fWWpjOyW_>b44oq{!%QJtZt+uzHv&ykU(46 zmyLpwik~v{g)j#3cInrH0tedH$)Hk!Os4es9V#9|no7`3$6lP!>0=|+z2-cpl64rx zn1Y8@yc6S9p}7k}hNIgWtB-6|txc8Y2{4IwDVS1m8t-Nv*5Jz~O!%xeKguZFsy`!F zoKbNW?-B5u?(~i_b|rZV9u;U_!z0(RAsI>?9>M!mXc8dE3Vuj;r!p$Caw^2BDJ@^r zC1K}O0`RG*nB1jMm~jE-1*WD8LkGDI0qE8Y~tHi?I^| zhhq~9hLe#(i)ChGvPZ;RlbC1HpOMm>r+&|-6i_^SHUlbIg<)e}fuo{`i{xSxQvsFX z4w=P*8?r!e`<897LV5#vZGJvkDMksw24dloibXueq*->>>xpdDDaqvrReT5^Cc%z1 z;n;?m6R1v{H%m!8fsZKosEUu_Nr8Qvw%>9;)Spj&eOtwMBsD&}$Tax} ztSp;%ecCYf(PDuo_M|qG=S)-D%4qp1%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epuff-projekt3-catan/ch/zhaw/catan/SiedlerBoard.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/SiedlerBoard.class index 4b09bb65402dd24f0cfd33458b3c5225c21edf2f..f7ba4520ee5d7b545b75ff95dac0d51cdc8721f3 100644 GIT binary patch delta 17 ZcmeyW`BjtS)W2Q(7#J9AH*&lc0RT)k2Ydhk delta 17 ZcmeyW`BjtS)W2Q(7#J9AHgdcb0RT)f2YUbj diff --git a/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/SiedlerGame.class b/out/production/gruppe06-hufflepuff-projekt3-catan/ch/zhaw/catan/SiedlerGame.class index 984b723de228b39a84169066dc321ebf4c79e9df..ff2127d863743b275b372464eff3463c4572bb64 100644 GIT binary patch delta 45 zcmV+|0Mh@o6|@xy%Ko~(0000zu?Uw50oaqE2~7d%lQ0MulLZPk0rQhQ3ONA-lXeO| Dd<_oL delta 45 zcmV+|0Mh@o6|@xy%Ko~(0000yu?Uw50ojwF2~7d&lQ0MulLZPk0rZnR3ONA;lXeO| Dd@K&t diff --git a/src/ch/zhaw/catan/Dummy.java b/src/ch/zhaw/catan/Dummy.java index fdcab53..e9eb5db 100644 --- a/src/ch/zhaw/catan/Dummy.java +++ b/src/ch/zhaw/catan/Dummy.java @@ -15,15 +15,14 @@ public class Dummy { SHOW, QUIT } - private void run() { TextIO textIO = TextIoFactory.getTextIO(); TextTerminal textTerminal = textIO.getTextTerminal(); SiedlerBoard board = new SiedlerBoard(); board.addField(new Point(2, 2), Land.FOREST); - board.setCorner(new Point(3, 3), "RR"); - board.setEdge(new Point(2, 0), new Point(3, 1), "r"); + board.setCorner(new Point(3, 3), new Settlement(Config.Faction.RED)); + board.setEdge(new Point(2, 0), new Point(3, 1), new Road(Config.Faction.BLUE)); board.addFieldAnnotation(new Point(2, 2), new Point(3, 1), "AA"); Map lowerFieldLabel = new HashMap<>(); diff --git a/src/ch/zhaw/catan/Road.java b/src/ch/zhaw/catan/Road.java index 92ac502..360e794 100644 --- a/src/ch/zhaw/catan/Road.java +++ b/src/ch/zhaw/catan/Road.java @@ -4,8 +4,10 @@ import java.util.HashMap; public class Road { private HashMap buildCost; + private Config.Faction faction; - public Road() { + public Road(Config.Faction faction) { + this.faction = faction; buildCost = new HashMap<>(); buildCost.put(Config.Resource.BRICK,1); buildCost.put(Config.Resource.LUMBER,1); diff --git a/src/ch/zhaw/catan/Settlement.java b/src/ch/zhaw/catan/Settlement.java index 289e9e8..6e11e5d 100644 --- a/src/ch/zhaw/catan/Settlement.java +++ b/src/ch/zhaw/catan/Settlement.java @@ -4,8 +4,10 @@ import java.util.HashMap; public class Settlement { private HashMap buildCost; + private Config.Faction faction; - public Settlement() { + public Settlement(Config.Faction faction) { + this.faction = faction; buildCost = new HashMap<>(); buildCost.put(Config.Resource.LUMBER,1); buildCost.put(Config.Resource.BRICK,1); diff --git a/src/ch/zhaw/catan/SiedlerBoard.java b/src/ch/zhaw/catan/SiedlerBoard.java index b073e13..502d852 100644 --- a/src/ch/zhaw/catan/SiedlerBoard.java +++ b/src/ch/zhaw/catan/SiedlerBoard.java @@ -8,7 +8,7 @@ import java.awt.*; import java.util.*; import java.util.List; -public class SiedlerBoard extends HexBoard { +public class SiedlerBoard extends HexBoard { Map lowerFieldLabel = new HashMap<>(); From aef0479cf57d126eb8fb35a226d18b0d77b32ef2 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 26 Nov 2021 11:41:00 +0100 Subject: [PATCH 5/5] Player created --- .idea/misc.xml | 2 +- src/ch/zhaw/catan/Player.java | 47 ++++++++++++++++++++++++++++-- src/ch/zhaw/catan/Siedler.java | 2 ++ src/ch/zhaw/catan/SiedlerGame.java | 9 +++++- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index c3dfb30..b573818 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/ch/zhaw/catan/Player.java b/src/ch/zhaw/catan/Player.java index 63490f3..965f7fd 100644 --- a/src/ch/zhaw/catan/Player.java +++ b/src/ch/zhaw/catan/Player.java @@ -1,6 +1,6 @@ package ch.zhaw.catan; -import java.util.ArrayList; +import java.util.HashMap; /** * New Class PLayer @@ -11,10 +11,51 @@ public class Player { private String name; private Config.Faction faction; - private Config.Resource resource; + private HashMap resources; + private int roadsToUse; + private int settlementsToUse; public Player (String name, Config.Faction faction){ - this.name = new name(" "); + //Datenfelder + this.name = name; + this.faction = faction; + roadsToUse = Config.Structure.ROAD.getStockPerPlayer(); + settlementsToUse = Config.Structure.SETTLEMENT.getStockPerPlayer(); + //Ressourcen initialisiern + resources = new HashMap<>(); + for(Config.Resource resource : Config.Resource.values()) { + resources.put(resource,0); + } } + + /** + * This method returns all the resources the player has at the moment + * @return HashMap + */ + public HashMap getResources() { + return resources; + } + + + public boolean buildRoad() { + if (roadsToUse > 0) { + roadsToUse--; + return true; + } + return false; + + } + + + public boolean buildSettlement() { + if (settlementsToUse > 0) { + settlementsToUse--; + return true; + } + return false; + } + + + } diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index 9c3ea12..7610db4 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -16,5 +16,7 @@ public class Siedler { TextTerminal textTerminal = textIO.getTextTerminal(); textTerminal.println(game.getBoard().getTextView()); + + } } diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 695b23a..b76c075 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -24,7 +24,9 @@ public class SiedlerGame { static final int FOUR_TO_ONE_TRADE_OFFER = 4; static final int FOUR_TO_ONE_TRADE_WANT = 1; - SiedlerBoard board; + private SiedlerBoard board; + private Player[] allPlayers; + private int winPoints; /** * Constructs a SiedlerGame game state object. @@ -38,6 +40,8 @@ public class SiedlerGame { public SiedlerGame(int winPoints, int numberOfPlayers) { board = new SiedlerBoard(); board.createFixGamefield(); + allPlayers = new Player[numberOfPlayers]; + this.winPoints = winPoints; } /** @@ -69,6 +73,9 @@ public class SiedlerGame { */ public List getPlayerFactions() { // TODO: Implement + Faction[] factions = new Faction[allPlayers.length]; + + return Collections.emptyList(); }