some more work

This commit is contained in:
2024-09-25 12:08:38 +02:00
parent bc6c483ba6
commit 2f9d60f1a8
26 changed files with 2434 additions and 60 deletions

View File

@@ -4,5 +4,7 @@ public interface IActionSetInfos
{
Version Version { get; set; }
public bool IsPublic { get; set; }
IEnumerable<InstallAction> Actions { get; }
}

View File

@@ -1,13 +1,16 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel;
namespace ModpackUpdater;
public class InstallInfos : IActionSetInfos
{
[JsonConverter(typeof(VersionConverter))]
[JsonConverter(typeof(Newtonsoft.Json.Converters.VersionConverter))]
public Version Version { get; set; }
[DefaultValue(true)]
public bool IsPublic { get; set; } = true;
public List<InstallAction> Actions { get; } = [];
IEnumerable<InstallAction> IActionSetInfos.Actions => Actions;

View File

@@ -0,0 +1,12 @@
namespace ModpackUpdater;
public enum ModLoader
{
Any,
Forge,
Cauldron,
LiteLoader,
Fabric,
Quilt,
NeoForge,
}

View File

@@ -8,7 +8,7 @@ public class UpdateAction : InstallAction
{
[DefaultValue(UpdateActionType.Update)]
[JsonConverter(typeof(StringEnumConverter))]
public UpdateActionType Type { get; set; }
public UpdateActionType Type { get; set; } = UpdateActionType.Update;
[DefaultValue(null)]
public string SrcPath { get; set; }

View File

@@ -1,13 +1,16 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel;
namespace ModpackUpdater;
public class UpdateInfo : IActionSetInfos
{
[JsonConverter(typeof(VersionConverter))]
[JsonConverter(typeof(Newtonsoft.Json.Converters.VersionConverter))]
public Version Version { get; set; }
[DefaultValue(true)]
public bool IsPublic { get; set; } = true;
public List<UpdateAction> Actions { get; } = [];
IEnumerable<InstallAction> IActionSetInfos.Actions => Actions.Cast<InstallAction>();