示例#1
0
        public FCraftCriterion([NotNull] XElement el)
        {
            if (el == null)
            {
                throw new ArgumentNullException(nameof(el));
            }

            // ReSharper disable PossibleNullReferenceException
            FromRank = Rank.Parse(el.Attribute("fromRank").Value);
            // ReSharper restore PossibleNullReferenceException
            if (FromRank == null)
            {
                throw new FormatException("Could not parse \"fromRank\"");
            }

            // ReSharper disable PossibleNullReferenceException
            ToRank = Rank.Parse(el.Attribute("toRank").Value);
            // ReSharper restore PossibleNullReferenceException
            if (ToRank == null)
            {
                throw new FormatException("Could not parse \"toRank\"");
            }

            Condition = (ConditionSet)AutoRank.FCraftConditions.Parse(el.Elements().First());
        }
示例#2
0
 public FCraftCriterion([NotNull] FCraftCriterion other)
 {
     if (other == null)
     {
         throw new ArgumentNullException(nameof(other));
     }
     FromRank  = other.FromRank;
     ToRank    = other.ToRank;
     Condition = other.Condition;
 }
示例#3
0
 public FCraftCriterion([NotNull] Rank fromRank, [NotNull] Rank toRank, [NotNull] ConditionSet condition)
 {
     FromRank  = fromRank ?? throw new ArgumentNullException(nameof(fromRank));
     ToRank    = toRank ?? throw new ArgumentNullException(nameof(toRank));
     Condition = condition ?? throw new ArgumentNullException(nameof(condition));
 }