/*
 * @license Private Source License v1.0.0
 * @copyright 2023 Reinhardt Weyers
 *
 * @author Reinhardt Weyers
 *
 * @version 0.1.0
 * 
 * Created On: 04/12/25
 * Last edited: 04/12/25
 */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RetroDev.OS
{
    /// <summary>
    /// Provides static methods to retrieve various system-related information from the device.
    /// </summary>
    public class OS
    {
        /// <summary>
        /// Gets the model of the device.
        /// </summary>
        public static string GetDeviceModel() => SystemInfo.deviceModel;

        /// <summary>
        /// Gets the type of the device (e.g., Phone, Tablet).
        /// </summary>
        public static string GetDeviceType() => SystemInfo.deviceType.ToString();

        /// <summary>
        /// Gets the operating system of the device.
        /// </summary>
        public static string GetOperatingSystem() => SystemInfo.operatingSystem;

        /// <summary>
        /// Gets the battery level of the device.
        /// </summary>
        public static float GetBatteryLevel() => SystemInfo.batteryLevel;

        /// <summary>
        /// Gets the name of the graphics device.
        /// </summary>
        public static string GetGraphicsDeviceName() => SystemInfo.graphicsDeviceName;

        /// <summary>
        /// Gets the size of the system memory.
        /// </summary>
        public static int GetSystemMemorySize() => SystemInfo.systemMemorySize;

        /// <summary>
        /// Gets the width of the screen.
        /// </summary>
        public static int GetScreenWidth() => Screen.width;

        /// <summary>
        /// Gets the height of the screen.
        /// </summary>
        public static int GetScreenHeight() => Screen.height;

        /// <summary>
        /// Checks if touch input is supported on the device.
        /// </summary>
        public static bool IsTouchSupported() => Input.touchSupported;

        /// <summary>
        /// Checks if the device has an accelerometer.
        /// </summary>
        public static bool HasAccelerometer() => SystemInfo.supportsAccelerometer;

        /// <summary>
        /// Checks if the device has a gyroscope.
        /// </summary>
        public static bool HasGyroscope() => SystemInfo.supportsGyroscope;

        /// <summary>
        /// Checks if location services are available on the device.
        /// </summary>
        public static bool HasLocationService() => SystemInfo.supportsLocationService;

        /// <summary>
        /// Gets the language setting of the device.
        /// </summary>
        public static string GetDeviceLanguage() => Application.systemLanguage.ToString();

        /// <summary>
        /// Gets the network reachability status of the device.
        /// </summary>
        public static NetworkReachability GetNetworkReachability() => Application.internetReachability;

        /// <summary>
        /// Gets the unique identifier of the device.
        /// </summary>
        public static string GetDeviceUDID() => SystemInfo.deviceUniqueIdentifier;

        /// <summary>
        /// Gets the type of processor on the device.
        /// </summary>
        public static string GetProcessorType() => SystemInfo.processorType;

        /// <summary>
        /// Gets the number of processor cores on the device.
        /// </summary>
        public static int GetProcessorCount() => SystemInfo.processorCount;

        /// <summary>
        /// Gets the current core processor on the device
        /// </summary>
        public static int GetProcessorFrequency() => SystemInfo.processorFrequency;
    }
}

