Commit a1e80c61 authored by Florian Grabowski's avatar Florian Grabowski
Browse files

Language Changes

parent b7e294e8
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
<excludeFolder url="file://$MODULE_DIR$/src/server/logs" /> <excludeFolder url="file://$MODULE_DIR$/src/server/logs" />
<excludeFolder url="file://$MODULE_DIR$/.idea/dataSources" /> <excludeFolder url="file://$MODULE_DIR$/.idea/dataSources" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
<excludeFolder url="file://$MODULE_DIR$/src/server/plugins" />
<excludeFolder url="file://$MODULE_DIR$/src/server/world" />
<excludeFolder url="file://$MODULE_DIR$/src/server/world_nether" />
<excludeFolder url="file://$MODULE_DIR$/src/server/world_the_end" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
......
...@@ -82,7 +82,7 @@ public class GenerateLayout implements CommandExecutor { ...@@ -82,7 +82,7 @@ public class GenerateLayout implements CommandExecutor {
return true; return true;
} else { } else {
Bukkit.getLogger().log(Level.SEVERE, "Kein Spieler gefunden."); Bukkit.getLogger().log(Level.SEVERE, "no player found.");
return false; return false;
} }
} }
......
...@@ -42,7 +42,7 @@ public class SetPreset implements CommandExecutor { ...@@ -42,7 +42,7 @@ public class SetPreset implements CommandExecutor {
t.run(); t.run();
} }
} else { } else {
Bukkit.getLogger().log(Level.SEVERE, "Kein Spieler gefunden."); Bukkit.getLogger().log(Level.SEVERE, "no player found.");
return false; return false;
} }
return true; return true;
......
...@@ -32,15 +32,15 @@ public class Klasse { ...@@ -32,15 +32,15 @@ public class Klasse {
public static int variablesMin= Integer.MAX_VALUE; public static int variablesMin= Integer.MAX_VALUE;
public static int variablesMax; public static int variablesMax;
public Duration bearbeiteteZeit; public Duration existingTime;
public static Duration bearbeiteteZeitMin; public static Duration existingTimeMin;
public static Duration bearbeiteteZeitMax; public static Duration existingTimeMax;
public Duration zeitSeitLetzterBearbeitung; public Duration lastEditingTime;
public static Duration zeitSeitLetzterBearbeitungMin; public static Duration lastEditingTimeMin;
public static Duration zeitSeitLetzterBearbeitungMax; public static Duration lastEditingTimeMax;
public Duration zeitSeitErstemCommit; public Duration firstCommitTime;
public static Duration zeitSeitErstemCommitMin; public static Duration firstCommitTimeMin;
public static Duration zeitSeitErstemCommitMax; public static Duration firstCommitTimeMax;
ArrayList<LocalDateTime> commitTimes; ArrayList<LocalDateTime> commitTimes;
public Klasse(int id, String name, String path, int qloc, int loc, int commits, int functions, int variables,int complexity, ArrayList<LocalDateTime> commitTimes){ public Klasse(int id, String name, String path, int qloc, int loc, int commits, int functions, int variables,int complexity, ArrayList<LocalDateTime> commitTimes){
...@@ -68,26 +68,26 @@ public class Klasse { ...@@ -68,26 +68,26 @@ public class Klasse {
this.name = name; this.name = name;
this.path = path; this.path = path;
this.commitTimes = commitTimes; this.commitTimes = commitTimes;
this.bearbeiteteZeit = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1), commitTimes.get(0)); this.existingTime = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1), commitTimes.get(0));
if (bearbeiteteZeit != null) { if (existingTime != null) {
if(bearbeiteteZeitMax == null)bearbeiteteZeitMax = Duration.ofMillis(Long.MIN_VALUE); if(existingTimeMax == null) existingTimeMax = Duration.ofMillis(Long.MIN_VALUE);
if(bearbeiteteZeitMin == null)bearbeiteteZeitMin = Duration.ofMillis((Long.MAX_VALUE)); if(existingTimeMin == null) existingTimeMin = Duration.ofMillis((Long.MAX_VALUE));
bearbeiteteZeitMax = (bearbeiteteZeitMax.toMillis() >= bearbeiteteZeit.toMillis()) ? bearbeiteteZeitMax:bearbeiteteZeit; existingTimeMax = (existingTimeMax.toMillis() >= existingTime.toMillis()) ? existingTimeMax : existingTime;
bearbeiteteZeitMin = (bearbeiteteZeitMin.toMillis() <= bearbeiteteZeit.toMillis()) ? bearbeiteteZeitMin:bearbeiteteZeit; existingTimeMin = (existingTimeMin.toMillis() <= existingTime.toMillis()) ? existingTimeMin : existingTime;
} }
this.zeitSeitLetzterBearbeitung = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(0),LocalDateTime.now()); this.lastEditingTime = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(0),LocalDateTime.now());
if (zeitSeitLetzterBearbeitung != null) { if (lastEditingTime != null) {
if(zeitSeitLetzterBearbeitungMax == null)zeitSeitLetzterBearbeitungMax = Duration.ofMillis(Long.MIN_VALUE); if(lastEditingTimeMax == null) lastEditingTimeMax = Duration.ofMillis(Long.MIN_VALUE);
if(zeitSeitLetzterBearbeitungMin == null)zeitSeitLetzterBearbeitungMin = Duration.ofMillis(Long.MAX_VALUE); if(lastEditingTimeMin == null) lastEditingTimeMin = Duration.ofMillis(Long.MAX_VALUE);
zeitSeitLetzterBearbeitungMax = (zeitSeitLetzterBearbeitungMax.toMillis() >= zeitSeitLetzterBearbeitung.toMillis()) ? zeitSeitLetzterBearbeitungMax:zeitSeitLetzterBearbeitung; lastEditingTimeMax = (lastEditingTimeMax.toMillis() >= lastEditingTime.toMillis()) ? lastEditingTimeMax : lastEditingTime;
zeitSeitLetzterBearbeitungMin = (zeitSeitLetzterBearbeitungMin.toMillis() <= zeitSeitLetzterBearbeitung.toMillis()) ? zeitSeitLetzterBearbeitungMin:zeitSeitLetzterBearbeitung; lastEditingTimeMin = (lastEditingTimeMin.toMillis() <= lastEditingTime.toMillis()) ? lastEditingTimeMin : lastEditingTime;
} }
this.zeitSeitErstemCommit = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1),LocalDateTime.now()); this.firstCommitTime = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1),LocalDateTime.now());
if (zeitSeitErstemCommit != null) { if (firstCommitTime != null) {
if(zeitSeitErstemCommitMax == null)zeitSeitErstemCommitMax = Duration.ofMillis(Long.MIN_VALUE); if(firstCommitTimeMax == null) firstCommitTimeMax = Duration.ofMillis(Long.MIN_VALUE);
if(zeitSeitErstemCommitMin == null)zeitSeitErstemCommitMin = Duration.ofMillis(Long.MAX_VALUE); if(firstCommitTimeMin == null) firstCommitTimeMin = Duration.ofMillis(Long.MAX_VALUE);
zeitSeitErstemCommitMax = (zeitSeitErstemCommitMax.toMillis() >= zeitSeitErstemCommit.toMillis()) ? zeitSeitErstemCommitMax:zeitSeitErstemCommit; firstCommitTimeMax = (firstCommitTimeMax.toMillis() >= firstCommitTime.toMillis()) ? firstCommitTimeMax : firstCommitTime;
zeitSeitErstemCommitMin = (zeitSeitErstemCommitMin.toMillis() <= zeitSeitErstemCommit.toMillis()) ? zeitSeitErstemCommitMin:zeitSeitErstemCommit; firstCommitTimeMin = (firstCommitTimeMin.toMillis() <= firstCommitTime.toMillis()) ? firstCommitTimeMin : firstCommitTime;
} }
} }
......
...@@ -7,7 +7,7 @@ import java.util.ArrayList; ...@@ -7,7 +7,7 @@ import java.util.ArrayList;
public class Quadrat extends Shape { public class Quadrat extends Shape {
private Boolean belegt; private Boolean filled;
public Structure getStructure() { public Structure getStructure() {
return structure; return structure;
...@@ -19,9 +19,9 @@ public class Quadrat extends Shape { ...@@ -19,9 +19,9 @@ public class Quadrat extends Shape {
this.bottomLeftCorner = bottomLeftCorner; this.bottomLeftCorner = bottomLeftCorner;
this.topRightCorner = topRightCorner; this.topRightCorner = topRightCorner;
this.xEdgeLength = topRightCorner.x-bottomLeftCorner.x; this.xEdgeLength = topRightCorner.x-bottomLeftCorner.x;
this.belegt=false; this.filled =false;
if(topRightCorner.y-bottomLeftCorner.y < 3 || topRightCorner.x-bottomLeftCorner.x <3){ if(topRightCorner.y-bottomLeftCorner.y < 3 || topRightCorner.x-bottomLeftCorner.x <3){
throw new IllegalArgumentException("keine Quadrate < 3 erlaubt"); throw new IllegalArgumentException("no Quadrate < 3 permitted");
} }
} }
...@@ -29,14 +29,14 @@ public class Quadrat extends Shape { ...@@ -29,14 +29,14 @@ public class Quadrat extends Shape {
this.xEdgeLength = xEdgeLength; this.xEdgeLength = xEdgeLength;
this.bottomLeftCorner = bottomLeftCorner; this.bottomLeftCorner = bottomLeftCorner;
this.topRightCorner = new Point(bottomLeftCorner.x+xEdgeLength,bottomLeftCorner.y+xEdgeLength); this.topRightCorner = new Point(bottomLeftCorner.x+xEdgeLength,bottomLeftCorner.y+xEdgeLength);
this.belegt = false; this.filled = false;
if(xEdgeLength < 3 || topRightCorner.x-bottomLeftCorner.x <3){ if(xEdgeLength < 3 || topRightCorner.x-bottomLeftCorner.x <3){
throw new IllegalArgumentException("keine Quadrate < 3 erlaubt " + xEdgeLength); throw new IllegalArgumentException("no Quadrate < 3 permitted " + xEdgeLength);
} }
} }
public ArrayList<Quadrat> setBelegt(Structure structure) { public ArrayList<Quadrat> setFilled(Structure structure) {
this.belegt = true; this.filled = true;
this.structure = structure; this.structure = structure;
ArrayList<Quadrat> result = new ArrayList<>(); ArrayList<Quadrat> result = new ArrayList<>();
if(this.xEdgeLength > structure.getWidth().x+3){//if you can split rest into more quads if(this.xEdgeLength > structure.getWidth().x+3){//if you can split rest into more quads
...@@ -54,8 +54,8 @@ public class Quadrat extends Shape { ...@@ -54,8 +54,8 @@ public class Quadrat extends Shape {
return result; return result;
} }
public Boolean getBelegt() { public Boolean getFilled() {
return belegt; return filled;
} }
public Point getWidth(){ public Point getWidth(){
......
...@@ -49,16 +49,16 @@ public class SimpleSquareLayout { ...@@ -49,16 +49,16 @@ public class SimpleSquareLayout {
first = false; first = false;
this.size = s.getWidth().x; this.size = s.getWidth().x;
layout.add(new Quadrat(new Point(0,0),s.getWidth().x)); layout.add(new Quadrat(new Point(0,0),s.getWidth().x));
layout.addAll(layout.get(0).setBelegt(s)); layout.addAll(layout.get(0).setFilled(s));
}else{ }else{
layout.sort(new CoordinateYComparator()); layout.sort(new CoordinateYComparator());
layout.sort(new CoordinateXComparator()); layout.sort(new CoordinateXComparator());
layout.sort(new WidthComparator()); layout.sort(new WidthComparator());
boolean noneFoundFlag = true; boolean noneFoundFlag = true;
for (int i = 0;i < layout.size();i++) { for (int i = 0;i < layout.size();i++) {
if((s.getWidth().x <= layout.get(i).getWidth().x)&&(!layout.get(i).getBelegt())&&(noneFoundFlag)){ if((s.getWidth().x <= layout.get(i).getWidth().x)&&(!layout.get(i).getFilled())&&(noneFoundFlag)){
noneFoundFlag = false; noneFoundFlag = false;
layout.addAll(layout.get(i).setBelegt(s)); layout.addAll(layout.get(i).setFilled(s));
} }
} }
if (noneFoundFlag){ if (noneFoundFlag){
...@@ -70,12 +70,12 @@ public class SimpleSquareLayout { ...@@ -70,12 +70,12 @@ public class SimpleSquareLayout {
private void appendQuad(Structure structure){ private void appendQuad(Structure structure){
Quadrat q = new Quadrat(new Point(this.size,0),structure.getWidth().x); Quadrat q = new Quadrat(new Point(this.size,0),structure.getWidth().x);
q.setBelegt(structure); q.setFilled(structure);
this.size += structure.getWidth().x; this.size += structure.getWidth().x;
layout.add(q); layout.add(q);
layout.add(new Quadrat(new Point(q.bottomLeftCorner.y,q.bottomLeftCorner.x),new Point(q.topRightCorner.y,q.topRightCorner.x))); // gespiegeltes Quadrat layout.add(new Quadrat(new Point(q.bottomLeftCorner.y,q.bottomLeftCorner.x),new Point(q.topRightCorner.y,q.topRightCorner.x))); // gespiegeltes Quadrat
layout.add(new Quadrat(new Point(q.bottomLeftCorner.x,q.bottomLeftCorner.x),structure.getWidth().x)); // Oberes rechtes Quadrat layout.add(new Quadrat(new Point(q.bottomLeftCorner.x,q.bottomLeftCorner.x),structure.getWidth().x)); // Oberes rechtes Quadrat
if((this.size-(2*structure.getWidth().x)) > 0){ //falls Abstand zwischen den Quadraten ist. if((this.size-(2*structure.getWidth().x)) > 0){ //in case there is space between those quads.
de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle rTop = new de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle(structure.getWidth().x,(this.size-2*structure.getWidth().x),new Point(q .topRightCorner.y,q.bottomLeftCorner.x)); de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle rTop = new de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle(structure.getWidth().x,(this.size-2*structure.getWidth().x),new Point(q .topRightCorner.y,q.bottomLeftCorner.x));
layout.addAll(rTop.splitToQuads(rTop)); layout.addAll(rTop.splitToQuads(rTop));
de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle rRight = new Rectangle((this.size-2*structure.getWidth().x),structure.getWidth().x,new Point(q.bottomLeftCorner.x,q.topRightCorner.y)); de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle rRight = new Rectangle((this.size-2*structure.getWidth().x),structure.getWidth().x,new Point(q.bottomLeftCorner.x,q.topRightCorner.y));
...@@ -85,12 +85,12 @@ public class SimpleSquareLayout { ...@@ -85,12 +85,12 @@ public class SimpleSquareLayout {
public Point getCoordinateOf(Structure structure) throws AttributeNotFoundException { public Point getCoordinateOf(Structure structure) throws AttributeNotFoundException {
for (Quadrat q:this.layout) { for (Quadrat q:this.layout) {
if(q.getBelegt()){ if(q.getFilled()){
if(q.getStructure().equals(structure)){ if(q.getStructure().equals(structure)){
return q.bottomLeftCorner; return q.bottomLeftCorner;
} }
} }
} }
throw new AttributeNotFoundException("Diese Structure ist nicht in der Ebene."); throw new AttributeNotFoundException("This structure couldn't found in the hierarchy.");
} }
} }
...@@ -25,7 +25,7 @@ public class SquarifiedTreemapLayout { ...@@ -25,7 +25,7 @@ public class SquarifiedTreemapLayout {
ArrayList<Row> tempRows = new ArrayList<>(); ArrayList<Row> tempRows = new ArrayList<>();
rows.stream().filter(r -> r.rectangles.containsValue(foundations.get(foundations.size()-1))).forEach(row -> rows.stream().filter(r -> r.rectangles.containsValue(foundations.get(foundations.size()-1))).forEach(row ->
tempRows.addAll(generateSubLayout(foundations.get(foundations.size()-1), new Rectangle(foundations.get(foundations.size()-1).getArea(), row.getWidth(), row.space.getOrigin())))); tempRows.addAll(generateSubLayout(foundations.get(foundations.size()-1), new Rectangle(foundations.get(foundations.size()-1).getArea(), row.getWidth(), row.space.getOrigin()))));
rows.addAll(tempRows);//letztes element bearbeitet und ein subLayout dafür angelegt. rows.addAll(tempRows);//last element processed and created a sublayout.
ArrayList<Foundation> tempFoundations = new ArrayList<>(); ArrayList<Foundation> tempFoundations = new ArrayList<>();
for (Structure s : foundations.get(foundations.size() - 1).getChildren()) { for (Structure s : foundations.get(foundations.size() - 1).getChildren()) {
...@@ -34,7 +34,7 @@ public class SquarifiedTreemapLayout { ...@@ -34,7 +34,7 @@ public class SquarifiedTreemapLayout {
} }
} }
foundations.remove(foundations.size()-1); foundations.remove(foundations.size()-1);
foundations.addAll(tempFoundations);//alle Kinder(nur Foundations) des letzten Elements in die Liste geschrieben und das Element entfernt. foundations.addAll(tempFoundations);//all children(just Foundations) added and removed the Foundation.
} while (!foundations.isEmpty()); } while (!foundations.isEmpty());
} }
...@@ -43,11 +43,11 @@ public class SquarifiedTreemapLayout { ...@@ -43,11 +43,11 @@ public class SquarifiedTreemapLayout {
ArrayList<Row> result = new ArrayList<>(); ArrayList<Row> result = new ArrayList<>();
result.add(new Row(rectangle)); result.add(new Row(rectangle));
for (Structure s : foundation.getChildren()) { for (Structure s : foundation.getChildren()) {
if (!result.get(result.size() - 1).checkInsert(s.getArea())) {//wenn einfügen in die bestehende Reihe das Seitenverhältnis verschlechtern würde. if (!result.get(result.size() - 1).checkInsert(s.getArea())) {//in case an insertion would make the ratio worse.
Row tempRow = new Row(result.get(result.size() - 1).getLeftover());//erzeige neue Reihe mit dem Rest des alten spaces als space. Row tempRow = new Row(result.get(result.size() - 1).getLeftover());//create new Row with the remaining space of the old Row.
result.add(tempRow);//füge die neue Reihe ans Ende der Sammlung ein. result.add(tempRow);//put the new Row at the end of the list.
} }
result.get(result.size() - 1).addRectangle(s.getArea(), s);//füge das Kind in die letzte Reihe ein, die in der Liste ist. result.get(result.size() - 1).addRectangle(s.getArea(), s);//put the child in the last Row of the list.
} }
return result; return result;
} }
......
...@@ -14,7 +14,7 @@ import java.util.Objects; ...@@ -14,7 +14,7 @@ import java.util.Objects;
import java.util.Random; import java.util.Random;
import java.util.logging.Level; import java.util.logging.Level;
@SuppressWarnings("ALL")
public class Builder { public class Builder {
Server server; Server server;
...@@ -115,43 +115,41 @@ public class Builder { ...@@ -115,43 +115,41 @@ public class Builder {
addDescription(s.getLocation().clone().add(0, s.getDepth(), 0), s); addDescription(s.getLocation().clone().add(0, s.getDepth(), 0), s);
setAllChildren((Foundation) s); setAllChildren((Foundation) s);
} else {//TODO must be revisited to draw rectangular Buildings } else {//TODO must be revisited to draw rectangular Buildings
float ersterCommit = ((Building) s).klasse.zeitSeitErstemCommit.toDays(); float firstCommit = ((Building) s).klasse.firstCommitTime.toDays();
float scaleErsterCommit; float scaleFirstCommit;
if((float)Klasse.zeitSeitErstemCommitMin.toDays() == (float)Klasse.zeitSeitErstemCommitMax.toDays()){ if((float)Klasse.firstCommitTimeMin.toDays() == (float)Klasse.firstCommitTimeMax.toDays()){
scaleErsterCommit = 0f; scaleFirstCommit = 0f;
}else { }else {
scaleErsterCommit = ((ersterCommit - (float)Klasse.zeitSeitErstemCommitMin.toDays()) / ((float) Klasse.zeitSeitErstemCommitMax.toDays() - (float)Klasse.zeitSeitErstemCommitMin.toDays())); scaleFirstCommit = ((firstCommit - (float)Klasse.firstCommitTimeMin.toDays()) / ((float) Klasse.firstCommitTimeMax.toDays() - (float)Klasse.firstCommitTimeMin.toDays()));
} }
Duration d = ((Building) s).klasse.zeitSeitLetzterBearbeitung; Duration d = ((Building) s).klasse.lastEditingTime;
float letzterBearbeitung = d.toDays(); float lastCommit = d.toDays();
float scaleLetzterBearbeitung; float scaleLastCommit;
if((float)Klasse.zeitSeitLetzterBearbeitungMin.toDays() == (float)Klasse.zeitSeitLetzterBearbeitungMax.toDays()){ if((float)Klasse.lastEditingTimeMin.toDays() == (float)Klasse.lastEditingTimeMax.toDays()){
scaleLetzterBearbeitung = 0f; scaleLastCommit = 0f;
}else { }else {
scaleLetzterBearbeitung = ((letzterBearbeitung - (float)Klasse.zeitSeitLetzterBearbeitungMin.toDays()) / ((float)Klasse.zeitSeitLetzterBearbeitungMax.toDays() - (float)Klasse.zeitSeitLetzterBearbeitungMin.toDays())); scaleLastCommit = ((lastCommit - (float)Klasse.lastEditingTimeMin.toDays()) / ((float)Klasse.lastEditingTimeMax.toDays() - (float)Klasse.lastEditingTimeMin.toDays()));
} }
Material facadeMaterial; Material facadeMaterial;
if(scaleErsterCommit < 0.10){ if(scaleFirstCommit < 0.10){
facadeMaterial = Material.WAXED_COPPER_BLOCK; facadeMaterial = Material.WAXED_COPPER_BLOCK;
}else if(scaleErsterCommit < 0.5){ }else if(scaleFirstCommit < 0.5){
facadeMaterial = Material.WAXED_EXPOSED_COPPER; facadeMaterial = Material.WAXED_EXPOSED_COPPER;
}else if(scaleErsterCommit < 0.90){ }else if(scaleFirstCommit < 0.90){
facadeMaterial = Material.WAXED_WEATHERED_COPPER; facadeMaterial = Material.WAXED_WEATHERED_COPPER;
}else { }else {
facadeMaterial = Material.WAXED_OXIDIZED_COPPER; facadeMaterial = Material.WAXED_OXIDIZED_COPPER;
} }
Material facadeInnerMaterial; Material facadeInnerMaterial;
if(scaleLetzterBearbeitung< 0.10){ if(scaleLastCommit< 0.10){
facadeInnerMaterial = Material.WHITE_STAINED_GLASS; facadeInnerMaterial = Material.WHITE_STAINED_GLASS;
}else if(scaleLetzterBearbeitung < 0.5){ }else if(scaleLastCommit < 0.5){
facadeInnerMaterial = Material.GLASS; facadeInnerMaterial = Material.GLASS;
}else if(scaleLetzterBearbeitung < 0.90){ }else if(scaleLastCommit < 0.90){
facadeInnerMaterial = Material.BLUE_STAINED_GLASS; facadeInnerMaterial = Material.BLUE_STAINED_GLASS;
}else { }else {
facadeInnerMaterial = Material.IRON_BARS; facadeInnerMaterial = Material.IRON_BARS;
} }
//System.out.println(letzterBearbeitung);
//System.out.println(scaleLetzterBearbeitung);
this.buildBuilding(s.getLocation().clone().add(1, s.getDepth() + 1,1), this.buildBuilding(s.getLocation().clone().add(1, s.getDepth() + 1,1),
s.getWidth().x - 2, s.getWidth().x - 2,
((Building) s).getHeight()+1, ((Building) s).getHeight()+1,
...@@ -208,9 +206,7 @@ public class Builder { ...@@ -208,9 +206,7 @@ public class Builder {
private void addDescription(Location startLocation, Structure structure) { private void addDescription(Location startLocation, Structure structure) {
if (structure.getClass() == Foundation.class) { if (structure.getClass() == Foundation.class) {
//if (!((Foundation) structure).getChildren().stream().anyMatch(s -> s.getClass() == Foundation.class)) {//no foundation in Children
setFoundationSing(startLocation,(Foundation) structure); setFoundationSing(startLocation,(Foundation) structure);
//}
} else { } else {
setWallSing(startLocation, (Building) structure, BlockFace.NORTH); setWallSing(startLocation, (Building) structure, BlockFace.NORTH);
setWallSing(startLocation, (Building) structure, BlockFace.EAST); setWallSing(startLocation, (Building) structure, BlockFace.EAST);
......
...@@ -16,7 +16,7 @@ public class Building extends Structure{ ...@@ -16,7 +16,7 @@ public class Building extends Structure{
this.height = height; this.height = height;
this.material = material; this.material = material;
if(this.width.x < 5){ if(this.width.x < 5){
throw new IllegalArgumentException("keine Gebäude kleiner 5 wegen 2 Gehweg"); throw new IllegalArgumentException("no buildings smaller than 5");
} }
} }
...@@ -28,7 +28,7 @@ public class Building extends Structure{ ...@@ -28,7 +28,7 @@ public class Building extends Structure{
this.name = name; this.name = name;
this.height = klasse.functions; this.height = klasse.functions;
if(this.width.x < 5 || this.width.y < 5){ if(this.width.x < 5 || this.width.y < 5){
throw new IllegalArgumentException("keine Gebäude kleiner 5 wegen 2 Gehweg"); throw new IllegalArgumentException("no buildings smaller than 5");
} }
} }
......
...@@ -220,7 +220,6 @@ public class Foundation extends Structure { ...@@ -220,7 +220,6 @@ public class Foundation extends Structure {
allFoundations.sort(new DepthComparator()); allFoundations.sort(new DepthComparator());
Collections.reverse(allFoundations); //higher Depths first Collections.reverse(allFoundations); //higher Depths first
for (Foundation f : allFoundations) { for (Foundation f : allFoundations) {
//if(!this.equals(f))
f.organizeFoundation(); f.organizeFoundation();
} }
} else { //normal Call and recursion } else { //normal Call and recursion
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment