parent
8b61927eae
commit
79cc4f3f3c
|
@ -0,0 +1 @@
|
|||
/out/
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,22 @@
|
|||
package ch.zhaw.catan;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* This Class represents a Road Object. It informs about the ressources needed to build a road
|
||||
*/
|
||||
public class Road {
|
||||
|
||||
final private HashMap<Config.Resource, Integer> buildCost;
|
||||
|
||||
public Road() {
|
||||
buildCost = new HashMap<>();
|
||||
buildCost.put(Config.Resource.LUMBER, 1);
|
||||
buildCost.put(Config.Resource.BRICK, 1);
|
||||
}
|
||||
|
||||
public HashMap<Config.Resource, Integer> getBuildCost() {
|
||||
return buildCost;
|
||||
}
|
||||
|
||||
}
|
|
@ -213,6 +213,13 @@ public class SiedlerGame {
|
|||
*/
|
||||
public boolean buildRoad(Point roadStart, Point roadEnd) {
|
||||
// TODO: Implement
|
||||
// 0.Is Edge 1. Check if Edge is empty 2. Check if One neighbors Corner is own settlement 3. Set road
|
||||
boolean validTask = true;
|
||||
while (validTask) {
|
||||
validTask = board.hasEdge(roadStart,roadEnd);
|
||||
validTask = board.getEdge(roadStart,roadEnd) == null;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue