using System;
using System.Collections.Generic;
using Dalamud;
using Dalamud.Data;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Plugin;
using Penumbra.GameData.Data;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
namespace Penumbra.GameData;
public static class GameData
{
///
/// Obtain an object identifier that can link a game path to game objects that use it, using your client language.
///
public static IObjectIdentifier GetIdentifier(DalamudPluginInterface pluginInterface, DataManager dataManager, ItemData itemData)
=> new ObjectIdentification(pluginInterface, dataManager, itemData, dataManager.Language);
///
/// Obtain an object identifier that can link a game path to game objects that use it using the given language.
///
public static IObjectIdentifier GetIdentifier(DalamudPluginInterface pluginInterface, DataManager dataManager, ItemData itemData, ClientLanguage language)
=> new ObjectIdentification(pluginInterface, dataManager, itemData, language);
///
/// Obtain a parser for game paths.
///
public static IGamePathParser GetGamePathParser()
=> new GamePathParser();
}
public interface IObjectIdentifier : IDisposable
{
///
/// An accessible parser for game paths.
///
public IGamePathParser GamePathParser { get; }
///
/// Add all known game objects using the given game path to the dictionary.
///
/// A pre-existing dictionary to which names (and optional linked objects) can be added.
/// The game path to identify.
public void Identify(IDictionary set, string path);
///
/// Return named information and possibly linked objects for all known game objects using the given path.
///
/// The game path to identify.
public Dictionary Identify(string path);
///
/// Identify an equippable item by its model values.
///
/// The primary model ID for the piece of equipment.
/// The secondary model ID for weapons, WeaponType.Zero for equipment and accessories.
/// The variant ID of the model.
/// The equipment slot the piece of equipment uses.
public IEnumerable Identify(SetId setId, WeaponType weaponType, ushort variant, EquipSlot slot);
///
public IEnumerable Identify(SetId setId, ushort variant, EquipSlot slot)
=> Identify(setId, 0, variant, slot);
/// Obtain a list of BNPC Name Ids associated with a BNPC Id.
public IReadOnlyList GetBnpcNames(uint bNpcId);
/// Obtain a list of Names and Object Kinds associated with a ModelChara ID.
public IReadOnlyList<(string Name, ObjectKind Kind, uint Id)> ModelCharaNames(uint modelId);
public int NumModelChara { get; }
}
public interface IGamePathParser
{
public ObjectType PathToObjectType(string path);
public GameObjectInfo GetFileInfo(string path);
public string VfxToKey(string path);
}