Example #1
0
 public ModDependencyAttribute(string modID, string version = "")
 {
     if (modID == null)
     {
         throw new ArgumentNullException(nameof(modID));
     }
     if (!ModInfo.IsValidModID(modID))
     {
         throw new ArgumentException(
                   $"'{ modID }' is not a valid mod ID. Please use only lowercase letters and numbers.", nameof(modID));
     }
     ModID   = modID;
     Version = version ?? "";
 }
Example #2
0
 public ModInfoAttribute(string name, string modID)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     if (modID == null)
     {
         throw new ArgumentNullException(nameof(modID));
     }
     if (name.Length == 0)
     {
         throw new ArgumentException(
                   "name can't be empty", nameof(name));
     }
     if (!ModInfo.IsValidModID(modID))
     {
         throw new ArgumentException(
                   $"'{ modID }' is not a valid mod ID. Please use only lowercase letters and numbers.", nameof(modID));
     }
     Name  = name;
     ModID = modID;
 }