feat(cordis): 接入上下文组合与模组事务热替换
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user