package de._82grfl1bif.kpiVisualizer.structures; import de._82grfl1bif.kpiVisualizer.data.Klasse; import org.bukkit.Material; import java.awt.Point; public class Building extends Structure{ private final int height; public Klasse klasse = null; @Deprecated 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 < 5){ throw new IllegalArgumentException("no buildings smaller than 5"); } } public Building(Material material, Klasse klasse, String name){ //Buildings are Square -> no depth this.klasse = klasse; this.material = material; this.width = new Point(Math.round((klasse.variables+5)), Math.round((klasse.variables+5))); //TODO: make this work with treemap and square this.area = klasse.variables*25; this.name = name; this.height = klasse.functions; if(this.width.x < 5 || this.width.y < 5){ throw new IllegalArgumentException("no buildings smaller than 5"); } } public int getHeight() { return this.height; } @Override public Structure getFromTree(String checkName) { if(this.name.equals(checkName))return this; return null; } }