From ed0f9daef3c96fa913795f4bb5454085ec4d6406 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 29 Apr 2023 08:17:05 -0400 Subject: [PATCH] Slotting helper methods added. --- src/engine/gameManager/BuildingManager.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 0d9eb143..72e43752 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -47,6 +47,21 @@ public enum BuildingManager { return -1; } + public static Vector3fImmutable getSlotLocation(Building building, int slot) { + + if (slot == -1) + return Vector3fImmutable.ZERO; + + BuildingLocation buildingLocation; + buildingLocation = _slotLocations.get(building.meshUUID).get(slot); + + if (buildingLocation == null) { + Logger.error("Invalid slot for building: " + building.getObjectUUID()); + } + + return buildingLocation.getLoc(); + } + public static boolean playerCanManage(PlayerCharacter player, Building building) { if (player == null)