﻿using System.Collections.Generic;

namespace NeoriginPCSDK
{
    public class NeoPayFactory
    {
        public const string PlatformPayGoogle = "5";           // google支付
        public const string PlatformPayXsolla = "8";           // Xsolla支付
        public const string PlatformPayVirtualCoin = "16";     // 虚拟币支付
        public const string PlatformPaySteam = "21";           // Steam支付

        public static NeoBasePay CreatePayStrange (string payChannel)
        {
            return payChannel switch
            {
                PlatformPayGoogle =>new GooglePayImpl(),
                PlatformPaySteam => new SteamPayImpl(),
                PlatformPayXsolla => new XsollaPayImpl(),
                PlatformPayVirtualCoin => new VirtualCoinImpl(),
                _ => new XsollaPayImpl()
            };
        }

        public static bool payChannelSupport(List<int> payChannelList, string payChannel)
        {
            var ret = false;
            if (payChannelList is not { Count: > 0 } || !payChannelList.Contains(int.Parse(payChannel)))
                return ret;

            ret = payChannel switch
            {
                PlatformPayGoogle => true,
                PlatformPaySteam => true,
                PlatformPayXsolla => true,
                PlatformPayVirtualCoin => true,
                _ => ret
            };
            return ret;
        }
    }
}