コード例 #1
0
 public void FinalizeDataHolder()
 {
     foreach (var itemId in ItemIds.Where(itemId => itemId != -1).Where(itemId => !SetItemManager.ItemSetsRecordsByItemIds.ContainsKey(itemId)))
     {
         SetItemManager.ItemSetsRecordsByItemIds.Add(itemId, this);
     }
     MaxItemsCount = ItemIds.Count(i => i > 0);
     if (Stat1Type > 0)
     {
         SetBonuses.Add(new Asda2SetBonus {
             Type = Stat1Type, Value = Stat1Value
         });
     }
     if (Stat2Type > 0)
     {
         SetBonuses.Add(new Asda2SetBonus {
             Type = Stat2Type, Value = Stat2Value
         });
     }
     if (Stat3Type > 0)
     {
         SetBonuses.Add(new Asda2SetBonus {
             Type = Stat3Type, Value = Stat3Value
         });
     }
     foreach (var asda2SetBonuse in SetBonuses)
     {
         if (((Asda2ItemBonusType)asda2SetBonuse.Type) == Asda2ItemBonusType.HpRegeneration)
         {
             asda2SetBonuse.Value = (int)((asda2SetBonuse.Value + 0.5f) / 5);
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// Sets the values on select.
        /// </summary>
        protected override void SetValuesOnSelect()
        {
            var groupIds = ItemIds.Where(i => i != "0").AsIntegerList();

            if (groupIds.Any())
            {
                var groups = new GroupService(new RockContext())
                             .Queryable()
                             .Where(g => groupIds.Contains(g.Id))
                             .ToList();
                this.SetValues(groups);
            }
            else
            {
                this.SetValues(null);
            }
        }
コード例 #3
0
ファイル: AccountPicker.cs プロジェクト: SparkDevNetwork/Rock
        /// <summary>
        /// Sets the values on select.
        /// </summary>
        /// <exception cref="System.NotImplementedException"></exception>
        protected override void SetValuesOnSelect()
        {
            var accountIds = ItemIds.Where(i => i != "0").AsIntegerList();

            if (accountIds.Any())
            {
                var accounts = new FinancialAccountService(new RockContext())
                               .Queryable()
                               .Where(g => accountIds.Contains(g.Id))
                               .ToList();
                this.SetValues(accounts);
            }
            else
            {
                this.SetValues(null);
            }
        }
コード例 #4
0
 public void FinalizeDataHolder()
 {
     foreach (int key in ItemIds.Where(itemId => itemId != -1)
              .Where(itemId => !SetItemManager.ItemSetsRecordsByItemIds.ContainsKey(itemId)))
     {
         SetItemManager.ItemSetsRecordsByItemIds.Add(key, this);
     }
     MaxItemsCount = ItemIds.Count(i => i > 0);
     if (Stat1Type > 0)
     {
         SetBonuses.Add(new Asda2SetBonus
         {
             Type  = Stat1Type,
             Value = Stat1Value
         });
     }
     if (Stat2Type > 0)
     {
         SetBonuses.Add(new Asda2SetBonus
         {
             Type  = Stat2Type,
             Value = Stat2Value
         });
     }
     if (Stat3Type > 0)
     {
         SetBonuses.Add(new Asda2SetBonus
         {
             Type  = Stat3Type,
             Value = Stat3Value
         });
     }
     foreach (Asda2SetBonus setBonuse in SetBonuses)
     {
         if (setBonuse.Type == 10)
         {
             setBonuse.Value = (int)((setBonuse.Value + 0.5) / 5.0);
         }
     }
 }