Change cache reloading and conflicts to actually keep the effective mod and not force full recalculations on every change.

This commit is contained in:
Ottermandias 2022-05-29 19:00:34 +02:00
parent ee87098386
commit 4b036c6c26
29 changed files with 778 additions and 457 deletions

View file

@ -7,45 +7,43 @@ using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
using Penumbra.GameData.Util;
namespace Penumbra.GameData
namespace Penumbra.GameData;
public static class GameData
{
public static class GameData
{
internal static ObjectIdentification? Identification;
internal static readonly GamePathParser GamePathParser = new();
internal static ObjectIdentification? Identification;
internal static readonly GamePathParser GamePathParser = new();
public static IObjectIdentifier GetIdentifier( DataManager dataManager, ClientLanguage clientLanguage )
public static IObjectIdentifier GetIdentifier( DataManager dataManager, ClientLanguage clientLanguage )
{
Identification ??= new ObjectIdentification( dataManager, clientLanguage );
return Identification;
}
public static IObjectIdentifier GetIdentifier()
{
if( Identification == null )
{
Identification ??= new ObjectIdentification( dataManager, clientLanguage );
return Identification;
throw new Exception( "Object Identification was not initialized." );
}
public static IObjectIdentifier GetIdentifier()
{
if( Identification == null )
{
throw new Exception( "Object Identification was not initialized." );
}
return Identification;
}
public static IGamePathParser GetGamePathParser()
=> GamePathParser;
return Identification;
}
public interface IObjectIdentifier
{
public void Identify( IDictionary< string, object? > set, GamePath path );
public static IGamePathParser GetGamePathParser()
=> GamePathParser;
}
public Dictionary< string, object? > Identify( GamePath path );
public Item? Identify( SetId setId, WeaponType weaponType, ushort variant, EquipSlot slot );
}
public interface IObjectIdentifier
{
public void Identify( IDictionary< string, object? > set, GamePath path );
public Dictionary< string, object? > Identify( GamePath path );
public Item? Identify( SetId setId, WeaponType weaponType, ushort variant, EquipSlot slot );
}
public interface IGamePathParser
{
public ObjectType PathToObjectType( GamePath path );
public GameObjectInfo GetFileInfo( GamePath path );
public string VfxToKey( GamePath path );
}
public interface IGamePathParser
{
public ObjectType PathToObjectType( GamePath path );
public GameObjectInfo GetFileInfo( GamePath path );
public string VfxToKey( GamePath path );
}