Use switch with type matching in place of if-else where possible

This commit is contained in:
Dean Herbert
2018-07-17 14:35:09 +09:00
parent b69f61886c
commit 825941aff1
12 changed files with 150 additions and 131 deletions

View File

@ -73,12 +73,17 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
downloader.Download();
};
downloader.DownloadState.ValueChanged += d =>
downloader.DownloadState.ValueChanged += state =>
{
if (d == BeatmapSetDownloader.DownloadStatus.Downloaded)
this.FadeOut(200);
else if (d == BeatmapSetDownloader.DownloadStatus.NotDownloaded)
this.FadeIn(200);
switch (state)
{
case BeatmapSetDownloader.DownloadStatus.Downloaded:
this.FadeOut(200);
break;
case BeatmapSetDownloader.DownloadStatus.NotDownloaded:
this.FadeIn(200);
break;
}
};
}
}