// EdenAutoMorpher_ProfileSaver_Script, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.profile.ProfileUtils
using System.Collections.Generic;
using UnityEngine;

public class ProfileUtils
{
    private ProfileUtils_BoneUtil boneUtil;

    private ProfileUtils_PoseUtil poseUtil;

    private string profileBasePath = "@Eden_Tools\\Eden_AutoMorpher\\Profiles";

    private string baseDataPath = "@Eden_Tools\\Eden_AutoMorpher\\ProfileSaver\\BaseData\\base.vb";

    private int profileVersion = 1;

    private string profileMagic = "PBVH";

    private string baseMagic = "PVTB";

    public ProfileUtils()
    {
        this.boneUtil = new ProfileUtils_BoneUtil();
        this.poseUtil = new ProfileUtils_PoseUtil();
    }

    public string GetProfileBasePath()
    {
        return this.profileBasePath;
    }

    public string GetBaseDataPath()
    {
        return this.baseDataPath;
    }

    public int GetProfileVersion()
    {
        return this.profileVersion;
    }

    public string GetProfileMagic()
    {
        return this.profileMagic;
    }

    public string GetBaseMagic()
    {
        return this.baseMagic;
    }

    public Dictionary<HumanBodyBones, HashSet<Transform>> GetHumanoidMeshBoneMap(Animator animator, IReadOnlyList<SkinnedMeshRenderer> bodyMeshes, float posTolerance = 0.0001f, float weightThreshold = 0.0001f)
    {
        return this.boneUtil.GetHumanoidMeshBoneMap(animator, bodyMeshes, posTolerance, weightThreshold);
    }

    public BoneSpatialData GetBoneSpatialData(HumanBodyBones refBone, HumanBodyBones[] influencedBones, Dictionary<HumanBodyBones, HashSet<Transform>> boneMap, List<ProfileBakedBodyMesh> sourceBodyBakedMeshes, bool addChildBones = false)
    {
        return this.poseUtil.GetBoneSpatialData(refBone, influencedBones, boneMap, sourceBodyBakedMeshes, addChildBones);
    }

    public HashSet<Transform> GetBodyMeshBones(SkinnedMeshRenderer smr, float weightThreshold = 0.0001f)
    {
        return this.boneUtil.GetBodyMeshBones(smr, weightThreshold);
    }

    public List<BoneData> GetBoneDatas(Transform rootTransform, HashSet<Transform> avatarBones, Dictionary<HumanBodyBones, HashSet<Transform>> sourceBoneMap)
    {
        return this.boneUtil.GetBoneDatas(rootTransform, avatarBones, sourceBoneMap);
    }
}
