Browse Source

maintenance resolution

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
0eb8da855d
  1. 8
      src/engine/gameManager/MaintenanceManager.java

8
src/engine/gameManager/MaintenanceManager.java

@ -88,7 +88,7 @@ public enum MaintenanceManager { @@ -88,7 +88,7 @@ public enum MaintenanceManager {
maintenanceDue = 0;
strongboxGold -= maintenanceDue;
tol.setStrongboxValue(strongboxGold); //update strongbox value
setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
return; //maintenance is paid, all done
} else {
maintenanceDue -= strongboxGold;
@ -106,7 +106,7 @@ public enum MaintenanceManager { @@ -106,7 +106,7 @@ public enum MaintenanceManager {
warehouseGold -= maintenanceDue;
warehouse.getResources().put(ItemBase.getItemBase(7),warehouseGold);
DbManager.WarehouseQueries.updateGold(warehouse, warehouseGold);
setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
//maintenance is paid, all done
} else {
//failed maintenance, derank asset
@ -161,7 +161,7 @@ public enum MaintenanceManager { @@ -161,7 +161,7 @@ public enum MaintenanceManager {
warehouse.getResources().put(ItemBase.getItemBase(1580004), lumberLeft);
warehouse.getResources().put(ItemBase.getItemBase(1580000), stoneLeft);
warehouse.getResources().put(ItemBase.getItemBase(1580018), wormwoodLeft);
setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
}else{
HandleMaintenanceDerank(tol);//handle derank or potential destruction of the city
}
@ -169,7 +169,7 @@ public enum MaintenanceManager { @@ -169,7 +169,7 @@ public enum MaintenanceManager {
}
public static void HandleMaintenanceDerank(Building tol){
setMaintDateTime(tol, tol.maintDateTime.plusDays(1)); //failed to pay maintenance, set next date for tomorrow
setMaintDateTime(tol, LocalDateTime.now().plusDays(1)); //failed to pay maintenance, set next date for tomorrow
tol.destroyOrDerank(null);
}
}

Loading…
Cancel
Save