//------------------------------------------------------------------------------
// <auto-generated>
//     This code was auto-generated by ExcelExporter
//     version 2.0
//     from https://github.com/xuzhuoxi/ExcelExporter 
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using UnityEngine;

namespace JLGames.RocketDriver.Samples.RpgMaterialDemo.Cfg.CfgTitle
{
    /**
     * @author {AUTHOR}
     * Created on {NowTimeStr} .
     * client 1 c#
     */
    [Serializable]
    public class CfgExchange
    {
        // 以下为属性声明
        // ID
        [SerializeField] private ushort id;
        // 类型
        [SerializeField] private byte type;
        // 允许最大批量数量
        [SerializeField] private ushort batch;
        // 源材料
        [SerializeField] private string source;
        // 目标材料
        [SerializeField] private string target;

        // 以下为Get方法
        /**
         * ID
         *
         * @remark 分组ID
         * @return ushort
         */
        public ushort Id => id;
        /**
         * 类型
         *
         * @remark 类型
         * @return byte
         */
        public byte Type => type;
        /**
         * 允许最大批量数量
         *
         * @remark 允许最大批量数量
         * @return ushort
         */
        public ushort Batch => batch;
        /**
         * 源材料
         *
         * @remark 格式：多个使用&连接
材料类型:材料id:材料数量
         * @return string
         */
        public string Source => source;
        /**
         * 目标材料
         *
         * @remark 格式：多个使用&连接
材料类型:材料id:材料数量
         * @return string
         */
        public string Target => target;
        // 以下为解释数据方法

        // Json数据解释
        public void ParseJson(string data)
        {
            JsonUtility.FromJsonOverwrite(data, this);
        }

        // 二进制数据解释
//		public void ParseBinary(proxy: xu.BinaryReaderProxy)
//		{   
            //this.id = proxy.();
            //this.type = proxy.();
            //this.batch = proxy.();
            //this.source = proxy.();
            //this.target = proxy.();
//		}

        // 静态实例化
        public static CfgExchange FromJson(string data)
        {
            return JsonUtility.FromJson<CfgExchange>(data);
        }
    }
}