Merge remote-tracking branch 'origin/main'

This commit is contained in:
Speedy Gonzalez 2021-11-26 10:58:27 +01:00
commit ef484a31ea
20 changed files with 50 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/out/

View File

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

View File

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

View File

@ -212,7 +212,18 @@ public class SiedlerGame {
* @return true, if the placement was successful * @return true, if the placement was successful
*/ */
public boolean buildRoad(Point roadStart, Point roadEnd) { 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; return false;
} }