/**
 * Copyright(c) Live2D Inc. All rights reserved.
 *
 * Use of this source code is governed by the Live2D Open Software license
 * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
 */
using System;
using UnityEngine;
namespace Live2D.Cubism.Framework.Json
{
    /// 
    /// Handles display info from cdi3.json.
    /// 
    [Serializable]
    public sealed class CubismDisplayInfo3Json
    {
        /// 
        /// Loads a cdi3.json.
        /// 
        /// cdi3.json to deserialize.
        /// Deserialized cdi3.json on success;  otherwise.
        public static CubismDisplayInfo3Json LoadFrom(string cdi3Json)
        {
            if (string.IsNullOrEmpty(cdi3Json))
            {
                return null;
            }
            var ret = JsonUtility.FromJson(cdi3Json);
            return ret;
        }
        #region Json Data
        /// 
        /// Json file format version.
        /// 
        [SerializeField]
        public int Version;
        /// 
        /// Array of model parameters.
        /// 
        [SerializeField]
        public SerializableParameters[] Parameters;
        /// 
        /// Array of ParameterGroups.
        /// 
        [SerializeField]
        public SerializableParameterGroups[] ParameterGroups;
        /// 
        /// Array of Parts.
        /// 
        [SerializeField]
        public SerializableParts[] Parts;
        #endregion
        #region Json Helpers
        [Serializable]
        public struct SerializableParameters
        {
            /// 
            /// The ID of the parameter.
            /// 
            [SerializeField]
            public string Id;
            /// 
            /// The Group ID of the parameter.
            /// 
            [SerializeField]
            public string GroupId;
            /// 
            /// The Name of the parameter.
            /// 
            [SerializeField]
            public string Name;
        }
        [Serializable]
        public struct SerializableParameterGroups
        {
            /// 
            /// The ID of the parameter.
            /// 
            [SerializeField]
            public string Id;
            /// 
            /// The Group ID of the parameter.
            /// 
            [SerializeField]
            public string GroupId;
            /// 
            /// The Name of the parameter.
            /// 
            [SerializeField]
            public string Name;
        }
        [Serializable]
        public struct SerializableParts
        {
            /// 
            /// The ID of the part.
            /// 
            [SerializeField]
            public string Id;
            /// 
            /// The Name of the part.
            /// 
            [SerializeField]
            public string Name;
        }
        #endregion
    }
}