Exemplo n.º 1
0
        //BuildItemUnitView
        public ItemProgress Upgraded(IDbConnection connection, GDetailPlanetDataModel planet, int userId, bool premiumIsActive, IServiceProvider resolver)
        {
            var bu = new BuildUpgrade();

            bu.SetData(planet.Turels, NativeName);
            if (!bu.IsUpgradeComplite(bu.Progress))
            {
                return(bu.Progress);
            }
            //planetService.SavePlanet();
            bu.Progress = ItemProgress.ProgressUpdateComplite(bu.Progress);
            BuildUpgrade.TransactionBuildUpdate(connection, planet, bu, resolver);
            return(bu.Progress);
        }
Exemplo n.º 2
0
        public ItemProgress Upgraded(IDbConnection connection, GDetailPlanetDataModel planet, int userId, bool premiumIsActive, IServiceProvider resolver)
        {
            var progress  = planet.BuildStorage;
            var preResult = new BuildUpgrade(planet.Resources, progress, NativeName);


            //todo  не правильно высчитывается время на азуре из за чего вылетает ошибка при ответе от сервера
            if (!preResult.IsUpgradeComplite(preResult.Progress))
            {
                return(preResult.Progress);
            }

            preResult.Progress             = ItemProgress.ProgressUpdateComplite(preResult.Progress);
            preResult.StorageResources.Max = MaxStorable(preResult.Progress.Level ?? 1, premiumIsActive);
            BuildUpgrade.TransactionBuildUpdate(connection, planet, preResult, resolver);
            return(preResult.Progress);
        }