Techblox Mod Manager / Launcher
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.

39 lines
1.2KB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace TBMM
  7. {
  8. public class ModInfo
  9. {
  10. public string Name { get; set; }
  11. /// <summary>
  12. /// Installed version. Can be null.
  13. /// </summary>
  14. public Version Version { get; set; }
  15. public Version LatestVersion { get; set; }
  16. /// <summary>
  17. /// Can be null.
  18. /// </summary>
  19. public string Description { get; set; }
  20. /// <summary>
  21. /// Can be null.
  22. /// </summary>
  23. public string Author { get; set; }
  24. /// <summary>
  25. /// The time when the mod was last updated by its author.
  26. /// </summary>
  27. public DateTime LastUpdated { get; set; }
  28. public bool Installed => Version != null;
  29. public string DownloadURL { get; set; }
  30. public HashSet<string> ModFiles { get; set; }
  31. public string UpdateDetails { get; set; }
  32. public bool Updatable => Version != null && LatestVersion != null && Version < LatestVersion;
  33. public bool? Broken { get; set; }
  34. public bool Outdated(DateTime lastGameUpdateTime) => LastUpdated != default && LastUpdated < lastGameUpdateTime;
  35. }
  36. }