/// <summary>
        /// Initializes a new instance of the <see cref="SpellDescription"/> class.
        /// </summary>
        /// <param name="metadata">Metadata for this <see cref="SpellDescription"/>.</param>
        /// <param name="school">The school of magic this spell belongs to.</param>
        /// <exception cref="ArgumentException">The <paramref name="school"/> parameter is not a valid school of magic.</exception>
        public SpellDescription(IRulesElementMetadata metadata, Trait school)
        {
            if (!school.IsSchoolTrait())
            {
                throw new ArgumentException($"{school} is not a valid school trait.", nameof(school));
            }

            Metadata = metadata;
            School   = school;
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RulesElement"/> class.
 /// </summary>
 /// <param name="metadata">Information about this <see cref="RulesElement"/>,
 /// translated into the user's preferred language.</param>
 protected RulesElement(IRulesElementMetadata metadata)
 {
     Metadata = metadata;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MagicMissile"/> class.
 /// </summary>
 /// <param name="metadata">Metadata for <see cref="MagicMissile"/>.</param>
 public MagicMissile(IRulesElementMetadata metadata)
     : base(metadata, Trait.Evocation)
 {
     Components = new SpellComponents[] { SpellComponents.Somatic, SpellComponents.Verbal };
     Traits     = new Trait[] { Trait.Force, Trait.Arcane, Trait.Occult };
 }