mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Final fixes for GameData.
This commit is contained in:
parent
702f8e3967
commit
ea40d5bc9c
20 changed files with 133 additions and 153 deletions
49
Penumbra.GameData/GameData.cs
Normal file
49
Penumbra.GameData/GameData.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Dalamud.Plugin;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.GameData.Util;
|
||||
|
||||
namespace Penumbra.GameData
|
||||
{
|
||||
public static class GameData
|
||||
{
|
||||
internal static ObjectIdentification? Identification;
|
||||
internal static readonly GamePathParser GamePathParser = new();
|
||||
|
||||
public static IObjectIdentifier GetIdentifier( DalamudPluginInterface pi )
|
||||
{
|
||||
Identification ??= new ObjectIdentification( pi );
|
||||
return Identification;
|
||||
}
|
||||
|
||||
public static IObjectIdentifier GetIdentifier( )
|
||||
{
|
||||
if( Identification == null )
|
||||
{
|
||||
throw new Exception( "Object Identification was not initialized." );
|
||||
}
|
||||
return Identification;
|
||||
}
|
||||
|
||||
public static IGamePathParser GetGamePathParser()
|
||||
=> GamePathParser;
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue