55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ShrinkModFramework
|
|
{
|
|
[Serializable]
|
|
public sealed class ShrinkModInfo
|
|
{
|
|
public string ModId { get; }
|
|
public string DisplayName { get; }
|
|
public string Version { get; }
|
|
public int LoadOrder { get; }
|
|
public Type EntryType { get; }
|
|
public bool AutoApplyHarmonyPatches { get; }
|
|
public IReadOnlyList<ShrinkModDependency> Dependencies { get; }
|
|
|
|
public ShrinkModInfo(string modId, string displayName, string version, int loadOrder, Type entryType,
|
|
bool autoApplyHarmonyPatches, IReadOnlyList<ShrinkModDependency> dependencies)
|
|
{
|
|
ModId = modId;
|
|
DisplayName = displayName;
|
|
Version = version;
|
|
LoadOrder = loadOrder;
|
|
EntryType = entryType;
|
|
AutoApplyHarmonyPatches = autoApplyHarmonyPatches;
|
|
Dependencies = dependencies;
|
|
}
|
|
|
|
public override string ToString() => $"{DisplayName} ({ModId}@{Version})";
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class ShrinkModDependency
|
|
{
|
|
public string ModId { get; }
|
|
public string MinimumVersion { get; }
|
|
public bool Optional { get; }
|
|
|
|
public ShrinkModDependency(string modId, string minimumVersion, bool optional)
|
|
{
|
|
ModId = modId;
|
|
MinimumVersion = minimumVersion;
|
|
Optional = optional;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
if (string.IsNullOrEmpty(MinimumVersion))
|
|
return Optional ? $"{ModId} (optional)" : ModId;
|
|
|
|
return Optional ? $"{ModId} >= {MinimumVersion} (optional)" : $"{ModId} >= {MinimumVersion}";
|
|
}
|
|
}
|
|
}
|