Added superclass structure to roads and settlement
This commit is contained in:
parent
8fb406bea0
commit
ce31d0f439
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,19 +1,8 @@
|
||||||
package ch.zhaw.catan;
|
package ch.zhaw.catan;
|
||||||
|
|
||||||
import java.util.HashMap;
|
public class Road extends Structure {
|
||||||
|
|
||||||
public class Road {
|
|
||||||
private HashMap<Config.Resource,Integer> buildCost;
|
|
||||||
private Config.Faction faction;
|
|
||||||
|
|
||||||
public Road(Config.Faction faction) {
|
public Road(Config.Faction faction) {
|
||||||
this.faction = faction;
|
super(faction);
|
||||||
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,9 @@
|
||||||
|
package ch.zhaw.catan;
|
||||||
|
|
||||||
|
public abstract class Structure {
|
||||||
|
private Config.Faction faction;
|
||||||
|
|
||||||
|
public Structure(Config.Faction faction) {
|
||||||
|
this.faction = faction;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue