diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index a12dc7a4..b8c85884 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -30,14 +30,14 @@ import java.util.concurrent.ConcurrentHashMap; public class Warehouse { public EnumSet locked = EnumSet.noneOf(Enum.ResourceType.class); - public int buildingUID; + public Building building; public City city; public ArrayList transactions = new ArrayList<>(); public ConcurrentHashMap resources = new ConcurrentHashMap<>(); public Warehouse(Building building) { - this.buildingUID = building.objectUUID; + this.building = building; this.city = building.getCity(); // New empty warehouse @@ -604,16 +604,16 @@ public class Warehouse { } public static void loadAllTransactions(Warehouse warehouse) { - warehouse.transactions = DbManager.WarehouseQueries.GET_TRANSACTIONS_FOR_WAREHOUSE(warehouse.buildingUID); + warehouse.transactions = DbManager.WarehouseQueries.GET_TRANSACTIONS_FOR_WAREHOUSE(warehouse.building.getObjectUUID()); } public static void AddTransactionToWarehouse(Warehouse warehouse, Enum.GameObjectType targetType, int targetUUID, Enum.TransactionType transactionType, Enum.ResourceType resource, int amount) { - if (!DbManager.WarehouseQueries.CREATE_TRANSACTION(warehouse.buildingUID, targetType, targetUUID, transactionType, resource, amount, DateTime.now())) + if (!DbManager.WarehouseQueries.CREATE_TRANSACTION(warehouse.building.getObjectUUID(), targetType, targetUUID, transactionType, resource, amount, DateTime.now())) return; - Transaction transaction = new Transaction(warehouse.buildingUID, targetType, targetUUID, transactionType, resource, amount, DateTime.now()); + Transaction transaction = new Transaction(warehouse.building.getObjectUUID(), targetType, targetUUID, transactionType, resource, amount, DateTime.now()); warehouse.transactions.add(transaction); }