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)) }); }
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(); }
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; }
public bool IsLogging() { return(DynamicProperties.GetOrAdd <int>(k.log) == 1); }