diff --git a/src/main/java/com/tvd12/gamebox/entity/MMOGridRoom.java b/src/main/java/com/tvd12/gamebox/entity/MMOGridRoom.java index ca69a81..d07c479 100644 --- a/src/main/java/com/tvd12/gamebox/entity/MMOGridRoom.java +++ b/src/main/java/com/tvd12/gamebox/entity/MMOGridRoom.java @@ -111,10 +111,7 @@ private void handleNeighboringCells( } } - public void addNearbyPlayersInCell(MMOPlayer currentPlayer, Cell cell) { - if (cell == null || cell.getNumberOfPlayers() == 0) { - return; - } + private void addNearbyPlayersInCell(MMOPlayer currentPlayer, Cell cell) { for (MMOPlayer nearByPlayer : cell.players) { currentPlayer.addNearbyPlayer(nearByPlayer); nearByPlayer.addNearbyPlayer(currentPlayer); @@ -220,9 +217,5 @@ public void addPlayer(MMOPlayer player) { public void removePlayer(MMOPlayer player) { players.remove(player); } - - public int getNumberOfPlayers() { - return players.size(); - } } } diff --git a/src/main/java/com/tvd12/gamebox/math/Bounds.java b/src/main/java/com/tvd12/gamebox/math/Bounds.java index c111316..95a89ad 100644 --- a/src/main/java/com/tvd12/gamebox/math/Bounds.java +++ b/src/main/java/com/tvd12/gamebox/math/Bounds.java @@ -63,7 +63,7 @@ public boolean doesOverlap(Bounds other) { } public Bounds getOctant(int index) { - OcLocation ocLocation = Bounds.OcLocation.of(index); + OcLocation ocLocation = OcLocation.of(index); float midX = (leftBottomBack.x + rightTopFront.x) / 2; float midY = (leftBottomBack.y + rightTopFront.y) / 2; float midZ = (leftBottomBack.z + rightTopFront.z) / 2; @@ -121,6 +121,7 @@ public String toString() { } private enum OcLocation { + LEFT_BOTTOM_BACK(0), LEFT_BOTTOM_FRONT(1), LEFT_TOP_BACK(2), diff --git a/src/main/java/com/tvd12/gamebox/math/Vec3.java b/src/main/java/com/tvd12/gamebox/math/Vec3.java index c0961d7..c78bb3d 100644 --- a/src/main/java/com/tvd12/gamebox/math/Vec3.java +++ b/src/main/java/com/tvd12/gamebox/math/Vec3.java @@ -13,12 +13,12 @@ public class Vec3 { public float z; public static final Vec3 ZERO = new Vec3(); - public static final Vec3 up = new Vec3(0.0f, 1f, 0.0f); - public static final Vec3 down = new Vec3(0.0f, -1f, 0.0f); - public static final Vec3 left = new Vec3(-1f, 0.0f, 0.0f); - public static final Vec3 right = new Vec3(1f, 0.0f, 0.0f); - public static final Vec3 forward = new Vec3(0.0f, 0.0f, 1f); - public static final Vec3 backward = new Vec3(0.0f, 0.0f, -1f); + public static final Vec3 UP = new Vec3(0.0f, 1f, 0.0f); + public static final Vec3 DOWN = new Vec3(0.0f, -1f, 0.0f); + public static final Vec3 LEFT = new Vec3(-1f, 0.0f, 0.0f); + public static final Vec3 RIGHT = new Vec3(1f, 0.0f, 0.0f); + public static final Vec3 FORWARD = new Vec3(0.0f, 0.0f, 1f); + public static final Vec3 BACKWARD = new Vec3(0.0f, 0.0f, -1f); public Vec3() { this(0.0f, 0.0f, 0.0f);