Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
ef484a31ea
|
@ -0,0 +1 @@
|
|||
/out/
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,17 @@
|
|||
package ch.zhaw.catan;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Road {
|
||||
private HashMap<Config.Resource,Integer> buildCost;
|
||||
|
||||
public Road() {
|
||||
buildCost = new HashMap<>();
|
||||
buildCost.put(Config.Resource.BRICK,1);
|
||||
buildCost.put(Config.Resource.LUMBER,1);
|
||||
}
|
||||
|
||||
public HashMap<Config.Resource,Integer> getBuildCost() {
|
||||
return buildCost;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package ch.zhaw.catan;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Settlement {
|
||||
private HashMap<Config.Resource,Integer> 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<Config.Resource,Integer> getBuildCost() {
|
||||
return buildCost;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue