dimensions instead of amount

Dieser Commit ist enthalten in:
Zeanon 2021-05-06 02:32:36 +02:00
Ursprung 8fc87dc62c
Commit f1d126dd9a

Datei anzeigen

@ -83,8 +83,7 @@ public class Countingwand {
+ point.getZ()
+ ColorConfig.OTHER
+ "] ("
+ ColorConfig.HIGHLIGHT
+ Countingwand.getAmount(selection.getKey(), selection.getValue())
+ Countingwand.getDimensions(selection.getKey(), selection.getValue())
+ ColorConfig.OTHER
+ ")");
}
@ -94,11 +93,15 @@ public class Countingwand {
selections.remove(p);
}
public int getAmount(final Point point1, final Point point2) {
public String getDimensions(final Point point1, final Point point2) {
if (point1 == null || point2 == null) {
return 0;
return ColorConfig.HIGHLIGHT + "0" + ColorConfig.OTHER + "," + ColorConfig.HIGHLIGHT + "0" + ColorConfig.OTHER + "," + ColorConfig.HIGHLIGHT + "0";
}
return ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getX() - point2.getX()) + 1) + ColorConfig.OTHER + ", " + ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getY() - point2.getY()) + 1) + ColorConfig.OTHER + ", " +ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getZ() - point2.getZ()) + 1) + ColorConfig.OTHER;
}
public int getAmount(final Point point1, final Point point2) {
return (Math.abs(point1.getX() - point2.getX()) + 1) * (Math.abs(point1.getY() - point2.getY()) + 1) * (Math.abs(point1.getZ() - point2.getZ()) + 1);
}
}