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; }