/// <summary> /// Получить элементы от которых зависит этот элемент /// </summary> public void getNeedsItems() { List <RelaysItem> rel = new List <RelaysItem>(); if (this.SelectedChaProperty != null) { var needAb = this.SelectedChaProperty.NeedAbilitisProperty.Where(n => n.KoeficientProperty > 0) .OrderByDescending(n => n.KoeficientProperty) .ToList(); foreach (var needAbility in needAb) { var progress = Convert.ToDouble(needAbility.AbilProperty.LevelProperty) / Convert.ToDouble(needAbility.AbilProperty.MaxLevelProperty); progress = Math.Round(progress * 100.0, 0); rel.Add( new RelaysItem { IdProperty = needAbility.AbilProperty.GUID, ElementToolTipProperty = needAbility.AbilProperty.NameOfProperty, PictureProperty = needAbility.AbilProperty.PictureProperty, BorderColorProperty = StaticMetods.getBorderColorFromRelaysWithHardness( Convert.ToInt32(needAbility.KoeficientProperty)), ReqvirementTextProperty = progress + "%" }); } } NeedsItemsVM.RelaysItemsesProperty = rel; }
/// <summary> /// Получить элементы на которые влияет этот элемент /// </summary> public void getRelaysItems() { var relaysItems = new List <RelaysItem>(); if (this.SelectedChaProperty != null && this.SelectedChaProperty.KExpRelayProperty > 0 && PersProperty.PersSettings.IsFudgeModeProperty == false) { relaysItems.Add( new RelaysItem { IdProperty = "exp", ElementToolTipProperty = "Опыт", PictureProperty = StaticMetods.getImagePropertyFromImage(Pers.ExpImageProperty), BorderColorProperty = StaticMetods.getBorderColorFromRelaysWithHardness( Convert.ToInt32(this.SelectedChaProperty.KExpRelayProperty)), ReqvirementTextProperty = StaticMetods.getTextFromRelaysWithHardness( Convert.ToInt32(this.SelectedChaProperty.KExpRelayProperty)) }); } RelaysItemsVm.RelaysItemsesProperty = relaysItems; }