]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/client/models/BoundingBoxBiomeBorder.java
Tidy up constructors on simple boxes
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / models / BoundingBoxBiomeBorder.java
1 package com.irtimaled.bbor.client.models;
2
3 import com.irtimaled.bbor.common.BoundingBoxType;
4 import com.irtimaled.bbor.common.models.AbstractBoundingBox;
5 import com.irtimaled.bbor.common.models.Coords;
6
7 public class BoundingBoxBiomeBorder extends AbstractBoundingBox {
8     private final Coords coords;
9     private final boolean north;
10     private final boolean east;
11     private final boolean south;
12     private final boolean west;
13
14     public BoundingBoxBiomeBorder(Coords coords, boolean north, boolean east, boolean south, boolean west) {
15         super(BoundingBoxType.BiomeBorder);
16         this.coords = coords;
17         this.north = north;
18         this.east = east;
19         this.south = south;
20         this.west = west;
21     }
22
23     @Override
24     public Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ) {
25         return coords.getX() >= minX &&
26                 coords.getZ() >= minZ &&
27                 coords.getX() <= maxX &&
28                 coords.getZ() <= maxZ;
29     }
30
31     @Override
32     protected double getDistanceX(double x) {
33         return x - coords.getX();
34     }
35
36     @Override
37     protected double getDistanceY(double y) {
38         return y - coords.getY();
39     }
40
41     @Override
42     protected double getDistanceZ(double z) {
43         return z - coords.getZ();
44     }
45
46     public Coords getCoords() {
47         return coords;
48     }
49
50     public boolean renderNorth() {
51         return north;
52     }
53
54     public boolean renderEast() {
55         return east;
56     }
57
58     public boolean renderSouth() {
59         return south;
60     }
61
62     public boolean renderWest() {
63         return west;
64     }
65
66 }