2020-12-01 13:26:00 -08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2020-05-03 19:15:27 -07:00
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Common.SystemInfo
|
|
|
|
|
{
|
|
|
|
|
public class SystemInfo
|
|
|
|
|
{
|
|
|
|
|
public virtual string OsDescription => $"{RuntimeInformation.OSDescription} ({RuntimeInformation.OSArchitecture})";
|
|
|
|
|
public virtual string CpuName => "Unknown";
|
|
|
|
|
public virtual ulong RamSize => 0;
|
2020-12-01 13:26:00 -08:00
|
|
|
|
public string RamSizeInMB => (RamSize == 0) ? "Unknown" : $"{RamSize / 1024 / 1024} MB";
|
2020-05-03 19:15:27 -07:00
|
|
|
|
|
|
|
|
|
public static SystemInfo Instance { get; }
|
|
|
|
|
|
|
|
|
|
static SystemInfo()
|
|
|
|
|
{
|
2020-12-01 13:26:00 -08:00
|
|
|
|
if (OperatingSystem.IsWindows())
|
2020-05-03 19:15:27 -07:00
|
|
|
|
{
|
2020-12-01 13:26:00 -08:00
|
|
|
|
Instance = new WindowsSystemInfo();
|
2020-05-03 19:15:27 -07:00
|
|
|
|
}
|
2020-12-01 13:26:00 -08:00
|
|
|
|
else if (OperatingSystem.IsLinux())
|
2020-05-03 19:15:27 -07:00
|
|
|
|
{
|
2020-12-01 13:26:00 -08:00
|
|
|
|
Instance = new LinuxSystemInfo();
|
2020-05-03 19:15:27 -07:00
|
|
|
|
}
|
2020-12-01 13:26:00 -08:00
|
|
|
|
else if (OperatingSystem.IsMacOS())
|
2020-05-03 19:15:27 -07:00
|
|
|
|
{
|
2020-12-01 13:26:00 -08:00
|
|
|
|
Instance = new MacOSSystemInfo();
|
2020-05-03 19:15:27 -07:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Instance = new SystemInfo();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|