Browse Source

Slotting helper methods added.

master
MagicBot 2 years ago
parent
commit
ed0f9daef3
  1. 15
      src/engine/gameManager/BuildingManager.java

15
src/engine/gameManager/BuildingManager.java

@ -47,6 +47,21 @@ public enum BuildingManager { @@ -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)

Loading…
Cancel
Save