mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-12-28 14:49:47 +01:00
5e6dc37aed
* common: Fix last warning in SystemInfo * info to Info * fix MacOSSystemInfo file name by delete the file * MacOSSysteminfo to MacOSSystemInfo
35 lines
No EOL
1,019 B
C#
35 lines
No EOL
1,019 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
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;
|
|
public string RamSizeInMB => (RamSize == 0) ? "Unknown" : $"{RamSize / 1024 / 1024} MB";
|
|
|
|
public static SystemInfo Instance { get; }
|
|
|
|
static SystemInfo()
|
|
{
|
|
if (OperatingSystem.IsWindows())
|
|
{
|
|
Instance = new WindowsSystemInfo();
|
|
}
|
|
else if (OperatingSystem.IsLinux())
|
|
{
|
|
Instance = new LinuxSystemInfo();
|
|
}
|
|
else if (OperatingSystem.IsMacOS())
|
|
{
|
|
Instance = new MacOSSystemInfo();
|
|
}
|
|
else
|
|
{
|
|
Instance = new SystemInfo();
|
|
}
|
|
}
|
|
}
|
|
} |