public CorporationHangarRentInfo GetCorporationHangarRentInfo()
        {
            var saveNeeded = false;

            if (!DynamicProperties.Contains(k.hangarPrice))
            {
                DynamicProperties.Update(k.hangarPrice, _corporationConfiguration.HangarPrice);
                saveNeeded = true;
            }

            if (!DynamicProperties.Contains(k.rentPeriod))
            {
                DynamicProperties.Update(k.rentPeriod, _corporationConfiguration.RentPeriod);
                saveNeeded = true;
            }

            if (saveNeeded)
            {
                this.Save();
            }

            return(new CorporationHangarRentInfo
            {
                price = DynamicProperties.GetOrAdd <int>(k.hangarPrice),
                period = TimeSpan.FromDays(DynamicProperties.GetOrAdd <int>(k.rentPeriod))
            });
        }
예제 #2
0
        public override void OnLoadFromDb()
        {
            if (DynamicProperties.Contains(k.depleted))
            {
                IsDepleted = DynamicProperties.GetOrAdd <int>(k.depleted) == 1;
            }
            else
            {
                DynamicProperties.Update(k.depleted, IsDepleted ? 1 : 0);
            }

            base.OnLoadFromDb();
        }
예제 #3
0
        public void FullCoreRecharge()
        {
            var currentCore = DynamicProperties.GetOrAdd <double>(k.currentCore);

            var coreMaxValue = CoreMax;

            if (currentCore >= coreMaxValue)
            {
                return;
            }

            DynamicProperties.Update(k.currentCore, coreMaxValue);
            Core = CoreMax;
        }
        private void Init()
        {
            EffectType currentEffect;

            if (DynamicProperties.Contains(k.currentEffect))
            {
                currentEffect = (EffectType)DynamicProperties.GetOrAdd <int>(k.currentEffect);
            }
            else
            {
                currentEffect = AvailableEffects.FirstOrDefault();
            }

            CurrentEffectType = currentEffect;
        }
예제 #5
0
 public bool IsLogging()
 {
     return(DynamicProperties.GetOrAdd <int>(k.log) == 1);
 }