refactoring
This commit is contained in:
parent
7874deff71
commit
e876e8a1aa
1 changed files with 14 additions and 34 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue