Esempio n. 1
0
 private void CalculateBuildQueue(HandlerEntities.City mappedCity, City city)
 {
     var calcRequest = new BuildingUpgradeHandlerRequest
     {
         City = mappedCity,
         CalculateBuidingUpgradeStatistics = true,
         ReturnInventory = true,
         ReturnFaciltiyAssignment = false
     };
     var calculateResults = _buildingUpgradeHandler.CalculateBuildQueue(calcRequest);
     city.RequiredProducts = calculateResults.RequiredProductQueue.Select(Mapper.Map<Product>).ToArray();
     city.RequiredProductsInCityStorage =
         calculateResults.RequiredProductsInCityStorageQueue.Select(Mapper.Map<Product>).ToArray();
     city.TotalProducts = calculateResults.TotalProductQueue.Select(Mapper.Map<Product>).ToArray();
     city.AvailableStorage = calculateResults.AvailableStorage.Select(Mapper.Map<Product>).ToArray();
 }
Esempio n. 2
0
 private static void UpdateIncludeInBuildingUpgradesFlag(City value, City city)
 {
     foreach (var bu in city.BuildingUpgrades)
     {
         var firstOrDefault = value.BuildingUpgrades.FirstOrDefault(x => x.Id == bu.Id);
         bu.CalculateInBuildingUpgrades = firstOrDefault == null || firstOrDefault.CalculateInBuildingUpgrades;
     }
 }