using System; using System.Collections.Generic; using Ceras; using Compression.BSA; using VFS; using Wabbajack.Common; using Wabbajack.Lib.Downloaders; namespace Wabbajack.Lib { public class RawSourceFile { public string Path; public RawSourceFile(VirtualFile file) { File = file; } public string AbsolutePath => File.StagedPath; public VirtualFile File { get; } public string Hash => File.Hash; public T EvolveTo() where T : Directive, new() { var v = new T(); v.To = Path; v.Hash = Hash; v.Size = File.Size; return v; } } public class ModList { /// /// Archives required by this modlist /// public List Archives; /// /// The game variant to which this game applies /// public Game GameType; /// /// The build version of Wabbajack used when compiling the Modlist /// public string WabbajackVersion; /// /// Install directives /// public List Directives; /// /// Name of the ModList /// public string Name; /// /// Author of the ModList /// public string Author; /// /// Description of the ModList /// public string Description; /// /// Hash of the banner-image /// public string Image; /// /// Website of the ModList /// public string Website; /// /// Hash of the readme /// public string Readme; /// /// Content Report in HTML form /// public string ReportHTML; } public class Directive { /// /// location the file will be copied to, relative to the install path. /// public string To; public long Size; public string Hash; } public class IgnoredDirectly : Directive { public string Reason; } public class NoMatch : IgnoredDirectly { } public class InlineFile : Directive { /// /// Data that will be written as-is to the destination location; /// public string SourceDataID; } public class ArchiveMeta : Directive { public string SourceDataID; } public enum PropertyType { Banner, Readme } /// /// File meant to be extracted before the installation /// public class PropertyFile : InlineFile { public PropertyType Type; } public class CleanedESM : InlineFile { public string SourceESMHash; } /// /// A file that has the game and MO2 folders remapped on installation /// public class RemappedInlineFile : InlineFile { } [MemberConfig(TargetMember.All)] public class FromArchive : Directive { private string _fullPath; /// /// MurMur3 hash of the archive this file comes from /// public string[] ArchiveHashPath; [Exclude] public VirtualFile FromFile; [Exclude] public string FullPath { get { if (_fullPath == null) _fullPath = string.Join("|", ArchiveHashPath); return _fullPath; } } } public class CreateBSA : Directive { public string TempID; public uint Type; public ArchiveStateObject State { get; set; } public List FileStates { get; set; } } public class PatchedFromArchive : FromArchive { /// /// The file to apply to the source file to patch it /// public string PatchID; } public class SourcePatch { public string RelativePath; public string Hash; } public class MergedPatch : Directive { public List Sources; public string PatchID; } public class Archive { /// /// MurMur3 Hash of the archive /// public string Hash; /// Meta INI for the downloaded archive /// public string Meta; /// /// Human friendly name of this archive /// public string Name; public long Size; public AbstractDownloadState State { get; set; } } public class IndexedArchive { public dynamic IniData; public string Meta; public string Name; public VirtualFile File { get; internal set; } } /// /// A archive entry /// public class IndexedEntry { /// /// MurMur3 hash of this file /// public string Hash; /// /// Path in the archive to this file /// public string Path; /// /// Size of the file (uncompressed) /// public long Size; } public class IndexedArchiveEntry : IndexedEntry { public string[] HashPath; } /// /// Data found inside a BSA file in an archive /// public class BSAIndexedEntry : IndexedEntry { /// /// MurMur3 hash of the BSA this file comes from /// public string BSAHash; } }