using UnityEditor;

// The VrchatHoldem folder is mounted at different places (Assets/VrchatHoldem in this repo's own project,
// Assets/Poker/VrchatHoldem when used as a submodule), so editor code finds it through a tracked asset
// inside it instead of hard-coding the path.
public static class HoldemPaths
{
    // HoldemAssembly.asmdef, at the root of the VrchatHoldem folder
    private const string AnchorGuid = "fe5a8dad7e605988ab41a5cd24988301";

    public static string Root
    {
        get
        {
            string anchor = AssetDatabase.GUIDToAssetPath(AnchorGuid);
            if (string.IsNullOrEmpty(anchor))
                throw new System.InvalidOperationException("HoldemAssembly.asmdef not found; is its .meta intact?");
            return anchor.Substring(0, anchor.LastIndexOf('/'));
        }
    }

    public static string Asset(string relativePath)
    {
        return Root + "/" + relativePath;
    }
}
