package de._82grfl1bif.KPI_Visualizer.structures; import de._82grfl1bif.KPI_Visualizer.data.Klasse; import org.bukkit.Material; import java.awt.Point; public class Building extends Structure{ private final int height; public Building(int width, int height, Material material){ //Buildings are Square -> no depth this.width.x = width; this.width.y = width; this.height = height; this.material = material; if(this.width.x < 3){ throw new IllegalArgumentException("keine Gebäude kleiner 3 wegen 2 Gehweg"); } } public Building(Point width, int height, Material material){ //Buildings are Square -> no depth this.width = width; this.height = height; this.material = material; if(this.width.x < 3 || this.width.y < 3){ throw new IllegalArgumentException("keine Gebäude kleiner 3 wegen 2 Gehweg"); } } public Building(Material material, Klasse klasse, String name){ //Buildings are Square -> no depth this.material = material; this.width = new Point(5,5); //TODO: make this work with treemap and square this.name = name; this.height = klasse.commits; // con be changed to likings TODO: find out which fits best. if(this.width.x < 3 || this.width.y < 3){ throw new IllegalArgumentException("keine Gebäude kleiner 3 wegen 2 Gehweg"); } } public int getHeight() { return this.height; } @Override public Structure getFromTree(String checkName) { if(this.name.equals(checkName))return this; return null; } }