static df8CategoryItem ResolveQuantity(df8CategoryItem input)
 {
     var result = (df8CategoryItem)input.Clone();
     if (result.GetAttribute("quantity") != null)
     {
         if (result.GetSingleItemByEnum(ItemsChoiceType.Weight) != null)
         {
             result.Items[result.ItemsElementName.ToList().FindIndex(x => x == ItemsChoiceType.Weight)] = Convert.ToDouble(result.GetSingleItemByEnum(ItemsChoiceType.Weight)) * Convert.ToDouble(result.GetAttribute("quantity").value);
         }
     }
     return result;
 }
 df8CategoryItem ResolveEquations(df8CategoryItem input)
 {
     var result = (df8CategoryItem)input.Clone();
     for (int i = 0; i < result.ItemsElementName.Length; i++)
     {
         if (result.ItemsElementName[i] != ItemsChoiceType.Attribute && result.ItemsElementName[i] != ItemsChoiceType.Reroll)
         {
             if (result.Items[i] is string && ((string)result.Items[i]).StartsWith("$", StringComparison.CurrentCulture))
             {
                 result.Items[i] = evaluator.Execute(((string)result.Items[i]).Substring(1)).ToString();
             }
         }
     }
     return result;
 }
 df8CategoryItem ResolveDicerolls(df8CategoryItem input)
 {
     var result = (df8CategoryItem)input.Clone();
     foreach (var attrib in result.GetAttributes())
     {
         if (attrib.value.Contains('d'))
         {
             var checkForDice = new System.Text.RegularExpressions.Regex(@"\d+d\d+");
             if (checkForDice.IsMatch(attrib.value))
             {
                 attrib.value = Dice.roll(attrib.value).ToString();
             }
         }
     }
     return result;
 }