changed Datatype of Road and Settlement in SiedlerBoard
This commit is contained in:
		
							parent
							
								
									ef484a31ea
								
							
						
					
					
						commit
						3adec5bd43
					
				| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_16" 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>
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -15,15 +15,14 @@ public class Dummy {
 | 
			
		|||
    SHOW, QUIT
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  private void run() {
 | 
			
		||||
    TextIO textIO = TextIoFactory.getTextIO();
 | 
			
		||||
    TextTerminal<?> textTerminal = textIO.getTextTerminal();
 | 
			
		||||
 | 
			
		||||
    SiedlerBoard board = new SiedlerBoard();
 | 
			
		||||
    board.addField(new Point(2, 2), Land.FOREST);
 | 
			
		||||
    board.setCorner(new Point(3, 3), "RR");
 | 
			
		||||
    board.setEdge(new Point(2, 0), new Point(3, 1), "r");
 | 
			
		||||
    board.setCorner(new Point(3, 3), new Settlement(Config.Faction.RED));
 | 
			
		||||
    board.setEdge(new Point(2, 0), new Point(3, 1), new Road(Config.Faction.BLUE));
 | 
			
		||||
    board.addFieldAnnotation(new Point(2, 2), new Point(3, 1), "AA");
 | 
			
		||||
 | 
			
		||||
    Map<Point, Label> lowerFieldLabel = new HashMap<>();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,8 +4,10 @@ import java.util.HashMap;
 | 
			
		|||
 | 
			
		||||
public class Road {
 | 
			
		||||
    private HashMap<Config.Resource,Integer> buildCost;
 | 
			
		||||
    private Config.Faction faction;
 | 
			
		||||
 | 
			
		||||
    public Road() {
 | 
			
		||||
    public Road(Config.Faction faction) {
 | 
			
		||||
        this.faction = faction;
 | 
			
		||||
        buildCost = new HashMap<>();
 | 
			
		||||
        buildCost.put(Config.Resource.BRICK,1);
 | 
			
		||||
        buildCost.put(Config.Resource.LUMBER,1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,8 +4,10 @@ import java.util.HashMap;
 | 
			
		|||
 | 
			
		||||
public class Settlement {
 | 
			
		||||
    private HashMap<Config.Resource,Integer> buildCost;
 | 
			
		||||
    private Config.Faction faction;
 | 
			
		||||
 | 
			
		||||
    public Settlement() {
 | 
			
		||||
    public Settlement(Config.Faction faction) {
 | 
			
		||||
        this.faction = faction;
 | 
			
		||||
        buildCost = new HashMap<>();
 | 
			
		||||
        buildCost.put(Config.Resource.LUMBER,1);
 | 
			
		||||
        buildCost.put(Config.Resource.BRICK,1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ import java.awt.*;
 | 
			
		|||
import java.util.*;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
public class SiedlerBoard extends HexBoard<Land, String, String, String> {
 | 
			
		||||
public class SiedlerBoard extends HexBoard<Land, Settlement, Road, String> {
 | 
			
		||||
 | 
			
		||||
    Map<Point, ch.zhaw.hexboard.Label> lowerFieldLabel = new HashMap<>();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue