namespace XGame.Editor.Build
{
    /// <summary>
    /// Android CPU architecture.
    /// 位操作
    /// </summary>
    public enum AndroidArchitecture
    {
        None = 0,
        /// <summary>
        /// 32-bit ARM architecture.
        /// </summary>
        ARMv7 = 1,
        /// <summary>
        /// 64-bit ARM architecture.
        /// </summary>
        ARM64 = 2,
#if UNITY_2020_OR_NEWER
        /// <summary>
        /// 32-bit Intel architecture.
        /// Unity_2020及以上
        /// </summary>
        X86 = 4,
        /// <summary>
        /// 64-bit Intel architecture.
        /// </summary>
        X86_64 = 8,
        /// <summary>
        /// All architectures.
        /// </summary>
        All = ARMv7 | ARM64 | X86 | X86_64,
#else
        /// <summary>
        /// All architectures.
        /// </summary>
        All = ARMv7 | ARM64,
#endif

    }

    public static class AndroidArchitectureExt
    {
        public static UnityEditor.AndroidArchitecture ToUnityImpl(this AndroidArchitecture architecture)
        {
            if (architecture == AndroidArchitecture.All)
            {
                return UnityEditor.AndroidArchitecture.All;
            }
            return (UnityEditor.AndroidArchitecture)architecture;
        }
    }
}
