Building.java 951 Bytes
Newer Older
Florian Grabowski's avatar
Florian Grabowski committed
1
2
3
4
package de._82grfl1bif.KPI_Visualizer.structures;

import org.bukkit.Material;

5
import java.awt.Point;
Florian Grabowski's avatar
Florian Grabowski committed
6
7
8
9
10

public class Building extends Structure{
    private final int height;

    public Building(int width, int height, Material material){ //Buildings are Square -> no depth
11
12
13
14
15
16
17
18
19
20
        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
Florian Grabowski's avatar
Florian Grabowski committed
21
22
23
        this.width = width;
        this.height = height;
        this.material = material;
24
25
        if(this.width.x < 3 || this.width.y < 3){
            throw new IllegalArgumentException("keine Gebäude kleiner 3 wegen 2 Gehweg");
Florian Grabowski's avatar
Florian Grabowski committed
26
27
28
29
30
31
32
        }
    }

    public int getHeight() {
        return this.height;
    }
}