diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index af4d862..d926afb 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -148,6 +148,14 @@ public class SiedlerGame { */ public boolean placeInitialSettlement(Point position, boolean payout) { // TODO: Implement + if(!validPositionForSettlement(position)){ + return false; + } + board.setCorner(position, new Settlement(allPlayers.get(activePlayer).getFaction())); + List lands = board.getLandsForCorner(position); + for (Config.Land land:lands){ + allPlayers.get(activePlayer).addResource(land.getResource(), 1); + } return true; } @@ -161,6 +169,10 @@ public class SiedlerGame { */ public boolean placeInitialRoad(Point roadStart, Point roadEnd) { // TODO: Implement + if (!validPositionForRoad(roadStart, roadEnd)){ + return false; + } + board.setEdge(roadStart, roadEnd, new Road(allPlayers.get(activePlayer).getFaction())); return true; }