You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. using System;
  2. using Version = SemVer.Version;
  3. // ReSharper disable CheckNamespace
  4. namespace IPA
  5. {
  6. /// <summary>
  7. /// A class to provide information about a mod on ModSaber.ML
  8. /// </summary>
  9. // ReSharper disable once IdentifierTypo
  10. [Obsolete("This is unused, and has been since the manifest was introduced. All functionality is provided by the manifest.")]
  11. public class ModsaberModInfo
  12. {
  13. /// <summary>
  14. /// The name the mod uses on ModSaber as an identifier.
  15. /// </summary>
  16. public string InternalName
  17. {
  18. get => _internalName;
  19. set
  20. {
  21. if (_internalName == null)
  22. {
  23. _internalName = value;
  24. }
  25. else
  26. {
  27. throw new Exception("Cannot change name one it has been set!");
  28. }
  29. }
  30. }
  31. private string _internalName;
  32. /// <summary>
  33. /// The version of the currently installed mod. Used to compare to the version on ModSaber. Should be a valid SemVer version.
  34. /// </summary>
  35. public string CurrentVersion
  36. {
  37. get => _currentVersion;
  38. set
  39. {
  40. if (_currentVersion == null)
  41. {
  42. var version = new Version(value); // check for valid version
  43. _currentVersion = value;
  44. SemverVersion = version;
  45. }
  46. else
  47. {
  48. throw new Exception("Cannot change version one it has been set!");
  49. }
  50. }
  51. }
  52. private string _currentVersion;
  53. internal Version SemverVersion;
  54. }
  55. }