private Level determineLockLevel(ushort buildingID) { Level buildingLockLevel = Buildings.getLockLevel(buildingID); if (buildingLockLevel != Level.None) { return(buildingLockLevel); } else { Byte districtID = Buildings.getDistrictID(buildingID); int buildingType = Buildings.getBuildingType(buildingID); Level districtLockLevel = Districts.getLockLevels(districtID)[buildingType]; if (districtLockLevel != Level.None) { return(districtLockLevel); } else { return(Level.None); } } }
private void updateBuildingView(ushort buildingID, Level buildingLockLevel) { if (buildingLockLevel != Level.None) { this.updateProgressPanel(this.panelBuildingProgress, buildingLockLevel, false); } else { Byte districtID = Buildings.getDistrictID(buildingID); int buildingType = Buildings.getBuildingType(buildingID); Level districtLockLevel = Districts.getLockLevels(districtID)[buildingType]; if (districtLockLevel != Level.None) { this.updateProgressPanel(this.panelBuildingProgress, districtLockLevel, true); } else { this.updateProgressPanel(this.panelBuildingProgress, Level.None, false); } } }