using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkTJuicer
{
    internal enum GOODS_TYPE
    {
        /// <summary>
        /// 未知
        /// </summary>
        NEITHER,
        /// <summary>
        /// 果汁
        /// </summary>
        JUICE
    }

    internal enum BATCHING_CLASS
    {
        HOLDER,
        MAIN_MATERIAL,
    }

    internal class PolymerBatching
    {
        internal const string Juicer_MAIN_BATCHIN1_LOC = "52";
        internal const string Juicer_MAIN_BATCHIN2_LOC = "53";
        internal const string Juicer_MAIN_BATCHIN3_LOC = "54";
        internal const string Juicer_MAIN_BATCHIN4_LOC = "55";
        internal const string COFFEE_HOLDER_LOC = "30";
        internal const string TEA_HOLDER_LOC = "51";
        public static Dictionary<string, GOODS_TYPE> GOODS_TYPES = new Dictionary<string, GOODS_TYPE>() {
            {Juicer_MAIN_BATCHIN1_LOC,GOODS_TYPE.JUICE},
            {Juicer_MAIN_BATCHIN2_LOC,GOODS_TYPE.JUICE},
            {Juicer_MAIN_BATCHIN3_LOC,GOODS_TYPE.JUICE},
            {Juicer_MAIN_BATCHIN4_LOC,GOODS_TYPE.JUICE},
        };

        public GOODS_TYPE GoodsType { get; set; }
        public BATCHING_CLASS BatchingClass { get; set; }
        private string loc;

        public string Loc
        {
            get { return loc; }
            set
            {
                loc = value;
                if (GOODS_TYPES.ContainsKey(loc))
                    GoodsType = GOODS_TYPES[loc];
                switch (loc)
                {
                    case COFFEE_HOLDER_LOC:
                    case TEA_HOLDER_LOC:
                        BatchingClass = BATCHING_CLASS.HOLDER;
                        break;
                    default:
                        BatchingClass = BATCHING_CLASS.MAIN_MATERIAL;
                        break;
                }
            }
        }

        internal static Dictionary<string, PolymerBatching> BuildAll()
        {
            Dictionary<string, PolymerBatching> temp = new Dictionary<string, PolymerBatching>();
            foreach (var item in GOODS_TYPES)
            {
                temp.Add(item.Key, new PolymerBatching() { Loc = item.Key });
            }
            return temp;
        }
    }
}
