[Save/Sync] Work on ModConfig loading.
This commit is contained in:
@@ -14,10 +14,9 @@ namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
#region ModConfigurationInfo
|
||||
|
||||
public partial record ModConfigInfo : IModConfigInfo
|
||||
public record ModConfigInfo : IModConfigInfo
|
||||
{
|
||||
public ContentPackage Package { get; init; }
|
||||
public string PackageName { get; init; }
|
||||
public ImmutableArray<IAssemblyResourceInfo> Assemblies { get; init; }
|
||||
public ImmutableArray<ILuaScriptResourceInfo> LuaScripts { get; init; }
|
||||
public ImmutableArray<IConfigResourceInfo> Configs { get; init; }
|
||||
@@ -42,6 +41,8 @@ public record BaseResourceInfo : IBaseResourceInfo
|
||||
public bool Optional { get; init; }
|
||||
public string InternalName { get; init; }
|
||||
public ContentPackage OwnerPackage { get; init; }
|
||||
public ImmutableArray<Identifier> RequiredPackages { get; init; }
|
||||
public ImmutableArray<Identifier> IncompatiblePackages { get; init; }
|
||||
}
|
||||
|
||||
public record AssemblyResourceInfo : BaseResourceInfo, IAssemblyResourceInfo
|
||||
|
||||
@@ -6,6 +6,18 @@ using System.Globalization;
|
||||
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
public interface IDependencyInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// List of dependency packages required by this resource.
|
||||
/// </summary>
|
||||
ImmutableArray<Identifier> RequiredPackages { get; }
|
||||
/// <summary>
|
||||
/// List of packages incompatible with this resource.
|
||||
/// </summary>
|
||||
ImmutableArray<Identifier> IncompatiblePackages { get; }
|
||||
}
|
||||
|
||||
public interface IPlatformInfo
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
@@ -8,5 +9,10 @@ public partial interface IModConfigInfo : IAssembliesResourcesInfo,
|
||||
{
|
||||
// package info
|
||||
ContentPackage Package { get; }
|
||||
string PackageName { get; }
|
||||
}
|
||||
|
||||
public record ResourceParserInfo(
|
||||
ContentPackage Owner,
|
||||
XElement Element,
|
||||
ImmutableArray<Identifier> Required,
|
||||
ImmutableArray<Identifier> Incompatible);
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Globalization;
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
|
||||
public interface IBaseResourceInfo : IResourceInfo, IDataInfo {}
|
||||
public interface IBaseResourceInfo : IResourceInfo, IDataInfo, IDependencyInfo {}
|
||||
|
||||
public interface IConfigResourceInfo : IBaseResourceInfo {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user