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"?>
|
||||
<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" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,19 +1,8 @@
|
|||
package ch.zhaw.catan;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Road {
|
||||
private HashMap<Config.Resource,Integer> buildCost;
|
||||
private Config.Faction faction;
|
||||
public class Road extends Structure {
|
||||
|
||||
public Road(Config.Faction faction) {
|
||||
this.faction = faction;
|
||||
buildCost = new HashMap<>();
|
||||
buildCost.put(Config.Resource.BRICK,1);
|
||||
buildCost.put(Config.Resource.LUMBER,1);
|
||||
}
|
||||
|
||||
public HashMap<Config.Resource,Integer> getBuildCost() {
|
||||
return buildCost;
|
||||
super(faction);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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