
using System.Collections.Generic;

namespace tysdk
{
    public enum EAccoutType
    {
        hwGoogle,
        hwFacebook,
        hwGuest,
        none
    }
    
    public class EAccoutTypeName
    {
        public static string hwGoogle   = "hwGoogle";
        public static string hwFacebook = "hwFacebook";
        public static string hwGuest    = "hwGuest";
    }
    public interface ITYSdkCallback { }

    public class LoginInfo : ITYSdkCallback
    {
        public bool isSuccess;
        public int userId;
        public string StrUserId => userId.ToString();
        public string msg;
        public int code;
    }

    public class PaymentInfo : ITYSdkCallback
    {
        public bool isSuccess => code == "0";
        public int count;
        public string orderId;
        public string productId;
        public string price;

        public string code;
        public string msg;

        public override string ToString()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }
    
    public class ProductListInfo: ITYSdkCallback
    {
        public int code = 1;
        public string msg = string.Empty;
        public List<SKUDetail> products;
    }

    public class SKUDetail
    {
        public string description;
        public string ourProductId;
        public string price;
        public string price_amount_micros;
        public string price_currency_code;
        public string productId;
        public string title;
        public string type;
    }

    public class ATTInfo : ITYSdkCallback
    {
        public bool isAccepted;
    }

    public class ADLoadInfo
    {
        public bool isSuccess => code == "0";
        public string code;
        public string errStr;

        public override string ToString()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }

    public enum EShowAdState : byte
    {
        StartShow = 1,
        Reward = 2,
        Loading = 3,
        LoadFaild = 4,
        ShowFaild = 5,
        Closed = 6,
        Finished = 7,
        TimeOut = 8
    }

    public class ShowADInfo
    {
        public string code;
        public string message;
        public string reward;
        public EShowAdState state => (EShowAdState)int.Parse(code);

        public override string ToString()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }
}
