Change everything in collection caches to use IMod and introduce TemporaryMod.

This commit is contained in:
Ottermandias 2022-06-18 16:00:20 +02:00
parent c578bd3a49
commit fc767589a2
18 changed files with 129 additions and 74 deletions

View file

@ -14,7 +14,7 @@ public partial class MetaManager
public struct MetaManagerCmp : IDisposable
{
public CmpFile? File = null;
public readonly Dictionary< RspManipulation, Mod > Manipulations = new();
public readonly Dictionary< RspManipulation, IMod > Manipulations = new();
public MetaManagerCmp()
{ }
@ -39,7 +39,7 @@ public partial class MetaManager
Manipulations.Clear();
}
public bool ApplyMod( RspManipulation m, Mod mod )
public bool ApplyMod( RspManipulation m, IMod mod )
{
#if USE_CMP
Manipulations[ m ] = mod;

View file

@ -17,7 +17,7 @@ public partial class MetaManager
{
public readonly ExpandedEqdpFile?[] Files = new ExpandedEqdpFile?[CharacterUtility.NumEqdpFiles - 2]; // TODO: female Hrothgar
public readonly Dictionary< EqdpManipulation, Mod > Manipulations = new();
public readonly Dictionary< EqdpManipulation, IMod > Manipulations = new();
public MetaManagerEqdp()
{ }
@ -51,7 +51,7 @@ public partial class MetaManager
Manipulations.Clear();
}
public bool ApplyMod( EqdpManipulation m, Mod mod )
public bool ApplyMod( EqdpManipulation m, IMod mod )
{
#if USE_EQDP
Manipulations[ m ] = mod;

View file

@ -14,7 +14,7 @@ public partial class MetaManager
public struct MetaManagerEqp : IDisposable
{
public ExpandedEqpFile? File = null;
public readonly Dictionary< EqpManipulation, Mod > Manipulations = new();
public readonly Dictionary< EqpManipulation, IMod > Manipulations = new();
public MetaManagerEqp()
{ }
@ -39,7 +39,7 @@ public partial class MetaManager
Manipulations.Clear();
}
public bool ApplyMod( EqpManipulation m, Mod mod )
public bool ApplyMod( EqpManipulation m, IMod mod )
{
#if USE_EQP
Manipulations[ m ] = mod;

View file

@ -18,7 +18,7 @@ public partial class MetaManager
public EstFile? BodyFile = null;
public EstFile? HeadFile = null;
public readonly Dictionary< EstManipulation, Mod > Manipulations = new();
public readonly Dictionary< EstManipulation, IMod > Manipulations = new();
public MetaManagerEst()
{ }
@ -51,7 +51,7 @@ public partial class MetaManager
Manipulations.Clear();
}
public bool ApplyMod( EstManipulation m, Mod mod )
public bool ApplyMod( EstManipulation m, IMod mod )
{
#if USE_EST
Manipulations[ m ] = mod;

View file

@ -14,7 +14,7 @@ public partial class MetaManager
public struct MetaManagerGmp : IDisposable
{
public ExpandedGmpFile? File = null;
public readonly Dictionary< GmpManipulation, Mod > Manipulations = new();
public readonly Dictionary< GmpManipulation, IMod > Manipulations = new();
public MetaManagerGmp()
{ }
@ -38,7 +38,7 @@ public partial class MetaManager
}
}
public bool ApplyMod( GmpManipulation m, Mod mod )
public bool ApplyMod( GmpManipulation m, IMod mod )
{
#if USE_GMP
Manipulations[ m ] = mod;

View file

@ -18,7 +18,7 @@ public partial class MetaManager
public readonly struct MetaManagerImc : IDisposable
{
public readonly Dictionary< Utf8GamePath, ImcFile > Files = new();
public readonly Dictionary< ImcManipulation, Mod > Manipulations = new();
public readonly Dictionary< ImcManipulation, IMod > Manipulations = new();
private readonly ModCollection _collection;
private static int _imcManagerCount;
@ -65,7 +65,7 @@ public partial class MetaManager
Manipulations.Clear();
}
public bool ApplyMod( ImcManipulation m, Mod mod )
public bool ApplyMod( ImcManipulation m, IMod mod )
{
#if USE_IMC
Manipulations[ m ] = mod;

View file

@ -30,7 +30,7 @@ public partial class MetaManager : IDisposable
}
}
public bool TryGetValue( MetaManipulation manip, [NotNullWhen(true)] out Mod? mod )
public bool TryGetValue( MetaManipulation manip, [NotNullWhen(true)] out IMod? mod )
{
mod = manip.ManipulationType switch
{
@ -86,7 +86,7 @@ public partial class MetaManager : IDisposable
Imc.Dispose();
}
public bool ApplyMod( MetaManipulation m, Mod mod )
public bool ApplyMod( MetaManipulation m, IMod mod )
{
return m.ManipulationType switch
{