refactoring

This commit is contained in:
Marco Carvalho 2024-04-06 13:52:32 -03:00
commit e876e8a1aa

View file

@ -28,27 +28,15 @@ namespace Ryujinx.HLE.FileSystem
public static bool TryGetRealPath(string switchContentPath, out string realPath) public static bool TryGetRealPath(string switchContentPath, out string realPath)
{ {
switch (switchContentPath) realPath = switchContentPath switch
{ {
case SystemContent: SystemContent => Path.Combine(AppDataManager.BaseDirPath, SystemNandPath, Contents),
realPath = Path.Combine(AppDataManager.BaseDirPath, SystemNandPath, Contents); UserContent => Path.Combine(AppDataManager.BaseDirPath, UserNandPath, Contents),
break; SdCardContent => Path.Combine(GetSdCardPath(), Nintendo, Contents),
case UserContent: System => Path.Combine(AppDataManager.BaseDirPath, SystemNandPath),
realPath = Path.Combine(AppDataManager.BaseDirPath, UserNandPath, Contents); User => Path.Combine(AppDataManager.BaseDirPath, UserNandPath),
break; _ => null,
case SdCardContent: };
realPath = Path.Combine(GetSdCardPath(), Nintendo, Contents);
break;
case System:
realPath = Path.Combine(AppDataManager.BaseDirPath, SystemNandPath);
break;
case User:
realPath = Path.Combine(AppDataManager.BaseDirPath, UserNandPath);
break;
default:
realPath = null;
break;
}
return realPath != null; return realPath != null;
} }
@ -67,21 +55,13 @@ namespace Ryujinx.HLE.FileSystem
public static bool TryGetContentPath(StorageId storageId, out string contentPath) public static bool TryGetContentPath(StorageId storageId, out string contentPath)
{ {
switch (storageId) contentPath = storageId switch
{ {
case StorageId.BuiltInSystem: StorageId.BuiltInSystem => SystemContent,
contentPath = SystemContent; StorageId.BuiltInUser => UserContent,
break; StorageId.SdCard => SdCardContent,
case StorageId.BuiltInUser: _ => null,
contentPath = UserContent; };
break;
case StorageId.SdCard:
contentPath = SdCardContent;
break;
default:
contentPath = null;
break;
}
return contentPath != null; return contentPath != null;
} }