Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public abstract class CustomRegion {
public abstract World getWorld();

public abstract boolean contains(BlockVector3 pos);
public abstract BlockVector3 getMin();
public abstract BlockVector3 getMax();
public abstract BlockVector3 getPos1();
public abstract BlockVector3 getPos2();

public final boolean contains(Location loc) {
if (loc == null || loc.getWorld() == null) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public World getWorld() {
}

@Override
public BlockVector3 getMin() {
public BlockVector3 getPos1() {
return null;
}

@Override
public BlockVector3 getMax() {
public BlockVector3 getPos2() {
return null;
}
}
13 changes: 10 additions & 3 deletions src/main/java/fr/openmc/core/registry/regions/types/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
import fr.openmc.core.registry.regions.CustomRegion;

public abstract class Region extends CustomRegion {
private final BlockVector3 min;
private final BlockVector3 max;

public Region() {
this.max = getPos1().getMaximum(getPos2());
this.min = getPos1().getMinimum(getPos2());
}
@Override
public boolean contains(BlockVector3 pos) {
return pos.containedWithin(
getMin(),
getMax()
return pos.containedWithin(
min,
max
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public boolean contains(BlockVector3 pos) {
}

@Override
public BlockVector3 getMin() {
public BlockVector3 getPos1() {
return null;
}

@Override
public BlockVector3 getMax() {
public BlockVector3 getPos2() {
return null;
}
}
Loading