Skip to content

Commit

Permalink
[GMH] Corrigir nome da interface
Browse files Browse the repository at this point in the history
  • Loading branch information
luca16s committed Oct 15, 2024
1 parent e28a566 commit d0eb0e9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using iso.gmh.Core.Models;

public interface ICloudOperations
public interface IOperations
{
/// <summary>
/// Apaga arquivo do serviço de armazenamento na nuvem.
Expand All @@ -16,7 +16,7 @@ public interface ICloudOperations
/// <returns>
/// True caso tenha apagado e Falso caso não tenha sido apagado.
/// </returns>
Task<bool> DeleteSave(
Task<bool> Delete(
string path
);

Expand Down Expand Up @@ -53,7 +53,7 @@ string folderName
/// <returns>
/// True se o save pode ser recuperado e Falso caso não tenha sido recuperado.
/// </returns>
Task<bool> DownloadSaveData(
Task<bool> Download(
Game game
);

Expand All @@ -69,7 +69,7 @@ Game game
/// <returns>
/// True caso tenha sido salvo e Falso caso não tenha sido salvo.
/// </returns>
Task<bool> UploadSaveData(
Task<bool> Upload(
Game game,
bool overwrite = false
);
Expand Down
6 changes: 3 additions & 3 deletions iso.gmh.desktop/ViewModel/GamesListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public GamesListEntry SelectedSave
}
}

private readonly ICloudOperations Operations;
private readonly IOperations Operations;

private RelayCommand<GamesListEntry> deleteSaveCommand;

Expand All @@ -68,7 +68,7 @@ public GamesListViewModel()
: this(null, null, false)
{ }

public GamesListViewModel(IEnumerable<(string saveName, string path)> saveList, ICloudOperations operations, bool visible)
public GamesListViewModel(IEnumerable<(string saveName, string path)> saveList, IOperations operations, bool visible)
{
SavesList = Converter(saveList);
ShowList = visible
Expand All @@ -80,7 +80,7 @@ public GamesListViewModel(IEnumerable<(string saveName, string path)> saveList,

private async Task DeleteSave(GamesListEntry gameEntry)
{
if (await Operations.DeleteSave(gameEntry.PathToFile))
if (await Operations.Delete(gameEntry.PathToFile))
_ = SavesList.Remove(gameEntry);
}

Expand Down
6 changes: 3 additions & 3 deletions iso.gmh.desktop/ViewModel/GamesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IFactory<ESaveType, IBackupStrategy> BackupStrategy
) : BaseViewModel
{
private IBackupStrategy BackupStrategy;
private ICloudOperations CloudOperations => GetClientOperations();
private IOperations CloudOperations => GetClientOperations();

private RelayCommand<GameViewModel> _UploadCommand;
private RelayCommand<GameViewModel> _DownloadCommand;
Expand Down Expand Up @@ -187,7 +187,7 @@ private async Task<bool> UploadSave(MessageBoxResult messageBoxResult)
if (!exists)
_ = await CloudOperations.CreateFolder(GameInformation.OnlineSaveFolder);

return await CloudOperations.UploadSaveData(GameInformation, messageBoxResult == MessageBoxResult.Yes);
return await CloudOperations.Upload(GameInformation, messageBoxResult == MessageBoxResult.Yes);
}

private async Task<bool> DownloadSave()
Expand All @@ -200,6 +200,6 @@ private async Task<bool> DownloadSave()

GameInformation.SetSaveBackupExtension(BackupStrategy.GetFileExtension());

return await CloudOperations.DownloadSaveData(GameInformation);
return await CloudOperations.Download(GameInformation);
}
}
8 changes: 4 additions & 4 deletions iso.gmh.dropbox/DropboxOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class DropboxOperations(
DropboxClient client,
IBackupStrategy backupStrategy
) : ICloudOperations
) : IOperations
{
private readonly DropboxClient Client = client;
private readonly IBackupStrategy BackupStrategy = backupStrategy;
Expand Down Expand Up @@ -61,7 +61,7 @@ private static bool CheckIfFolderExistsInList(string folderName, ListFolderResul
return listaSaves;
}

public async Task<bool> DownloadSaveData(Game gameInformation)
public async Task<bool> Download(Game gameInformation)
{
if (gameInformation == null
|| !await CheckFolderExistence(gameInformation.OnlineSaveFolder))
Expand All @@ -88,7 +88,7 @@ public async Task<bool> DownloadSaveData(Game gameInformation)
return true;
}

public async Task<bool> UploadSaveData(Game gameInformation, bool overwriteSave)
public async Task<bool> Upload(Game gameInformation, bool overwriteSave)
{
if (gameInformation == null)
return false;
Expand Down Expand Up @@ -142,7 +142,7 @@ public async Task<bool> CreateFolder(string path)
return string.IsNullOrEmpty(result.Metadata.Id);
}

public async Task<bool> DeleteSave(string path)
public async Task<bool> Delete(string path)
{
if (string.IsNullOrWhiteSpace(path))
return false;
Expand Down

0 comments on commit d0eb0e9

Please sign in to comment.