|
|
|
@ -170,21 +170,6 @@ public enum MaintenanceManager {
@@ -170,21 +170,6 @@ public enum MaintenanceManager {
|
|
|
|
|
|
|
|
|
|
public static void HandleMaintenanceDerank(Building tol){ |
|
|
|
|
setMaintDateTime(tol, tol.maintDateTime.plusDays(1)); //failed to pay maintenance, set next date for tomorrow
|
|
|
|
|
if(tol.getRank() == 1) |
|
|
|
|
destroyAllCityAssets(tol.getCity()); |
|
|
|
|
try { |
|
|
|
|
tol.destroyOrDerank(null); |
|
|
|
|
}catch(Exception e){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public static void destroyAllCityAssets(City city){ |
|
|
|
|
if(city == null) |
|
|
|
|
Logger.error("Maintenance Failed To Find City To Destroy"); |
|
|
|
|
for(Building building : city.getParent().zoneBuildingSet){ |
|
|
|
|
building.setRank(-1); |
|
|
|
|
DbManager.removeFromCache(building); |
|
|
|
|
} |
|
|
|
|
city.getParent().zoneBuildingSet.clear(); |
|
|
|
|
tol.destroyOrDerank(null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|