using System;
using System.Runtime.Serialization;

namespace MyGame.Scenes.marketing.Scripts
{
    [DataContract]
    public class ShopCustomizeSettings
    {
        [DataMember]
        public int SignBoard = Const.ShopCustomizeDefaultSignBoardId;
        [DataMember]
        public int Decoration1 = Const.ShopCustomizeDefaultDecoration1Id;
        [DataMember]
        public int Cart = Const.ShopCustomizeDefaultCartId;
        [DataMember]
        public int Stock = Const.ShopCustomizeDefaultStockId;
        [DataMember]
        public int Decoration2 = Const.ShopCustomizeDefaultDecoration2Id; // 立て看板

        public int GetSetting(ShopCustomizeCategory category)
        {
            switch (category)
            {
                case ShopCustomizeCategory.Category1:
                    return SignBoard;
                case ShopCustomizeCategory.Category2:
                    return Decoration1;
                case ShopCustomizeCategory.Category3:
                    return Cart;
                case ShopCustomizeCategory.Category4:
                    return Stock;
                case ShopCustomizeCategory.Category5:
                    return Decoration2;
                // case ShopCustomizeCategory.Category6:
                //     return 0;
                default:
                    throw new ArgumentOutOfRangeException(nameof(category), category, null);
            }
        }

        public void SetSetting(ShopCustomizeData customizeData)
        {
            switch (customizeData.Category)
            {
                case ShopCustomizeCategory.Category1:
                    SignBoard = customizeData.id;
                    break;
                case ShopCustomizeCategory.Category2:
                    Decoration1 = customizeData.id;
                    break;
                case ShopCustomizeCategory.Category3:
                    Cart = customizeData.id;
                    break;
                case ShopCustomizeCategory.Category4:
                    Stock = customizeData.id;
                    break;
                case ShopCustomizeCategory.Category5:
                    Decoration2 = customizeData.id;
                    break;
                // case ShopCustomizeCategory.Category6:
                //     return 0;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
    }
}