Redesign classes and generally improve code

This commit is contained in:
Craftplacer
2020-06-08 00:39:33 +02:00
parent e95ffcb528
commit 101604e741
4 changed files with 43 additions and 49 deletions

View File

@ -19,31 +19,20 @@ namespace osu.Game.Updater
/// </summary>
public class SimpleUpdateManager : UpdateManager
{
public override bool CanCheckForUpdate => true;
private string version;
[Resolved]
private GameHost host { get; set; }
private OsuGameBase gameBase;
[BackgroundDependencyLoader]
private void load(OsuGameBase game)
{
gameBase = game;
version = game.Version;
CheckForUpdate();
Schedule(() => Task.Run(CheckForUpdateAsync));
}
public override void CheckForUpdate()
{
if (gameBase.IsDeployedBuild)
Schedule(() => Task.Run(checkForUpdateAsync));
}
private async void checkForUpdateAsync()
protected override async Task InternalCheckForUpdateAsync()
{
try
{