using Newtonsoft.Json.Linq; using Penumbra.Api.Enums; using Penumbra.Api.Helpers; namespace Penumbra.Api.Api; /// API methods pertaining to the tracking of resources in use by actors. public interface IPenumbraApiResourceTree { /// /// Get the given game objects' resources, as dictionaries of actual paths (that may be FS paths for redirected resources, or game paths for swapped or vanilla resources) to game paths. /// /// The game object indices for which to get the resources. /// An array of resource path dictionaries, of the same length and in the same order as the given game object index array. /// This function is best called right after the game objects are redrawn, as it may fail to resolve paths if relevant mod settings have changed since then. public Dictionary>?[] GetGameObjectResourcePaths(params ushort[] gameObjects); /// /// Get the player and player-owned game objects' resources, as dictionaries of actual paths (that may be FS paths for redirected resources, or game paths for swapped or vanilla resources) to game paths. /// /// A dictionary of game object indices to resource path dictionaries. /// This function is best called right after the game objects are redrawn, as it may fail to resolve paths if relevant mod settings have changed since then. public Dictionary>> GetPlayerResourcePaths(); /// /// Get the given game objects' resources of a given type, as dictionaries of resource handles to actual paths and, optionally, names and icons. /// /// Type of the resources to get, for example for materials. /// Whether to get names and icons along with the paths. /// The game object indices for which to get the resources. /// An array of resource information dictionaries, of the same length and in the same order as the given game object index array. /// /// It is the caller's responsibility to make sure the returned resource handles are still in use on the game object's draw object before using them. /// Also, callers should not use UI data for non-UI purposes. /// public GameResourceDict?[] GetGameObjectResourcesOfType(ResourceType type, bool withUiData, params ushort[] gameObjects); /// /// Get the player and player-owned game objects' resources of a given type, as dictionaries of resource handles to actual paths and, optionally, names and icons. /// /// Type of the resources to get, for example for materials. /// Whether to get names and icons along with the paths. /// A dictionary of game object indices to resource information dictionaries. /// /// It is the caller's responsibility to make sure the returned resource handles are still in use on the game object's draw object before using them. /// Also, callers should not use UI data for non-UI purposes. /// public Dictionary GetPlayerResourcesOfType(ResourceType type, bool withUiData); /// /// Get the given game objects' resource tree. /// /// Whether to get names and icons along with the paths. /// The game object indices for which to get the resources. /// An array of resource tree JObjects, of the same length and in the same order as the given game object index array. /// /// It is the caller's responsibility to make sure the returned resource handles are still in use on the game object's draw object before using them. /// Also, callers should not use UI data for non-UI purposes. /// public JObject?[] GetGameObjectResourceTrees(bool withUiData, params ushort[] gameObjects); /// /// Get the player and player-owned game objects' resource trees. /// /// Whether to get names and icons along with the paths. /// A dictionary of game object indices to resource trees. /// /// It is the caller's responsibility to make sure the returned resource handles are still in use on the game object's draw object before using them. /// Also, callers should not use UI data for non-UI purposes. /// public Dictionary GetPlayerResourceTrees(bool withUiData); }